N
Norman Kaye
Hi,
I've replaced my #include page header with a user control. now I want
to set the text on the buttons within the control depending upon
session variables -
I've tried using the Page_Load event in the user control's ascx.vb
codebehind, but that never seems to execute, I've tried to access the
user control from the main web page aspx.vb codebehind, by declaring
the user control and calling a public method in the ascx.vb - I can't
get that to work, so I've gone for a really simple solution - call
vbscript directly within the page. At least this code executes, but
does not change the button text.
I have as follows:
in the page:
<% PgHeader.OnHdrPageLoad() %>
<Hdr:Header id="PgHeader" name="PageHeader"
runat="server></Hdr:Header>
in the control:
<script language="vb" runat="server>
Sub OnHdrPageLoad()
If Session("LoggedIn") = True Then
button1.Text = "Log Out"
Label1.Text = "User :" & Session("UserName") & " Logged In")
Else
button1.Text = "Log In"
Label1.Text = ""
End If
End Sub
How is a simple thing like this supposed to be done?
Thanks in advance
I've replaced my #include page header with a user control. now I want
to set the text on the buttons within the control depending upon
session variables -
I've tried using the Page_Load event in the user control's ascx.vb
codebehind, but that never seems to execute, I've tried to access the
user control from the main web page aspx.vb codebehind, by declaring
the user control and calling a public method in the ascx.vb - I can't
get that to work, so I've gone for a really simple solution - call
vbscript directly within the page. At least this code executes, but
does not change the button text.
I have as follows:
in the page:
<% PgHeader.OnHdrPageLoad() %>
<Hdr:Header id="PgHeader" name="PageHeader"
runat="server></Hdr:Header>
in the control:
<script language="vb" runat="server>
Sub OnHdrPageLoad()
If Session("LoggedIn") = True Then
button1.Text = "Log Out"
Label1.Text = "User :" & Session("UserName") & " Logged In")
Else
button1.Text = "Log In"
Label1.Text = ""
End If
End Sub
How is a simple thing like this supposed to be done?
Thanks in advance