D
David C
I have a master page where I want to set a Label at the top of each page
that uses this master to a value based on the web page it is opening. Below
is some code from the master aspx and the page_load from the aspx.vb to help
with this problem. I am trying to set the value of LblHead.Text and it is
not working. Any help is appreciated.
David
Below is the label in the Master Page.
<form id="form1" runat="server">
<asp:Label ID="LblHead" runat="server" Text="Open Orders (Default
Text)" ForeColor="Blue" Font-Size="14"></asp:Label>
I also tried it in here (below) in the master but it did not work either.
<asp:ContentPlaceHolder id="head" runat="server">
<asp:Label ID="Label1" runat="server" Text="Open Orders (Default
Text)" ForeColor="Blue" Font-Size="14"></asp:Label>
</asp:ContentPlaceHolder>
Below is the OrdersMaster.master.vb Page_Load where I am trying to set the
value of LblHead.Text
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Not Request.ServerVariables("SCRIPT_NAME").ToString Is Nothing
Then
Dim strScript As String =
Request.ServerVariables("SCRIPT_NAME").ToString
If InStr(strScript, "OpenOrders") > 0 Then
LblHead.Text = "Currently Open Orders"
ElseIf InStr(strScript, "Estimates") > 0 Then
ElseIf InStr(strScript, "ClosedOrders") > 0 Then
ElseIf InStr(strScript, "Parts") > 0 Then
Else
End If
Else
LblHead.Text = "Currently Open Orders"
End If
End Sub
that uses this master to a value based on the web page it is opening. Below
is some code from the master aspx and the page_load from the aspx.vb to help
with this problem. I am trying to set the value of LblHead.Text and it is
not working. Any help is appreciated.
David
Below is the label in the Master Page.
<form id="form1" runat="server">
<asp:Label ID="LblHead" runat="server" Text="Open Orders (Default
Text)" ForeColor="Blue" Font-Size="14"></asp:Label>
I also tried it in here (below) in the master but it did not work either.
<asp:ContentPlaceHolder id="head" runat="server">
<asp:Label ID="Label1" runat="server" Text="Open Orders (Default
Text)" ForeColor="Blue" Font-Size="14"></asp:Label>
</asp:ContentPlaceHolder>
Below is the OrdersMaster.master.vb Page_Load where I am trying to set the
value of LblHead.Text
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Not Request.ServerVariables("SCRIPT_NAME").ToString Is Nothing
Then
Dim strScript As String =
Request.ServerVariables("SCRIPT_NAME").ToString
If InStr(strScript, "OpenOrders") > 0 Then
LblHead.Text = "Currently Open Orders"
ElseIf InStr(strScript, "Estimates") > 0 Then
ElseIf InStr(strScript, "ClosedOrders") > 0 Then
ElseIf InStr(strScript, "Parts") > 0 Then
Else
End If
Else
LblHead.Text = "Currently Open Orders"
End If
End Sub