Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Newbie question:

 

I Created two ascx file with the code of my old header.asp and footer.asp and put them in my products.aspx page like this:

Under <%@ Page %>

 

<%@ Register TagPrefix="Module" TagName="Header" Src="Header.ascx" %>

 

<%@ Register TagPrefix="Module" TagName="Footer" Src="Footer.ascx" %>

 

And set the usercontrols in the html part of the aspx page where I wanted to show

 

<MODULE:HEADER id="Header" runat="server"></MODULE:HEADER>

 

<MODULE:FOOTER id="Footer" runat="server"></MODULE:FOOTER>

 

that works but I have a problem. I have a variable called dbCustID that I set in my old header.asp and I used it in footer.asp. Now I get an error in footer.ascx that says "Name 'dbCustID' is not declared." So I thought that if I added this to the top of header.ascx it would work:

 

<script language="VB" runat="server">

Public dbCustID As String = "test"

</script>

 

No good. How can I access dbCustID which is set in header.ascx from footer.ascx? Thanks

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...