Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

controlling HTML frames via VB code

Hi all...I am working on a frameset that has two frames set as rows="*,0" which means that the second frame is invisible to the user and is used to house an independant timer script.

I have set up a debug variable that I want to be able to check on the frameset aspx that determines if debug mode is set to true then change the rows="*,150" so I can see whats going on.  Else rows="*,0".

Problem is, I don't know how to access the frameset via VB codebehind for my frameset aspx file.  Any ideas?
0
Lehthanis
Asked:
Lehthanis
  • 2
  • 2
1 Solution
 
nycsmith2kCommented:
Remember the vb code behind is running on the server.  If your timer is running in a frameset on the client, you're going to have to script a call to the server side code in order to execute the vb.net code behind.

Hope this helps.
c
0
 
LehthanisAuthor Commented:
How would I go about that though?  All I've ever worked with is <asp:> tags in .net, so I don't know for sure how to access server side variables.
0
 
nycsmith2kCommented:
OK, I read a little deeper into the question, how about this.

In your frameset.aspx you have the following:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="frameset.aspx.vb" Inherits="vbAdvancedFeatures.frameset"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
  <HEAD><TITLE>frameset</TITLE>
    <meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
    <meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
    <meta name=vs_defaultClientScript content="JavaScript">
    <meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
  </HEAD>
 
  <frameset rows="*,<%# lngSize %>" border=0 frameSpacing=0 frameBorder=0>
     <frame name="banner" src="frBanner.htm" scrolling="no" noresize>
          <frame name="Debug" src="debug.aspx" scrolling="no" noresize>
     </frameset>

</HTML>

***** then in your code behind you have the following

  Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        Dim boolDebug As Boolean
        'set your debug variable here.
        boolDebug = False
        If boolDebug Then
            'rows="*,150"
            lngSize = 150

        Else
            'rows =rows="*,0".
            lngSize = 0
        End If
        Me.DataBind()


    End Sub

***** this will allow you to control your frameset from the variable in the code-behind...
Hope this helps.
c
0
 
LehthanisAuthor Commented:
Thanx for the help!  this solved a lot of other problems I was having with passign information around...thank you!  I almost forgot about my classic asp roots in all the .net hub-bub.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now