Good Afternoon.
I'm working with the following web pages using ms vwd 2010 express:
Site.Master/Site.Master.vb, Login.aspx/Login.aspx.vb
I have the following code in the Login.aspx.vb program:
Dim WelcomeLabel As New Label
WelcomeLabel = CType(Master.FindControl("WelcomeLabel"), Label)
WelcomeLabel.Text = "Welcome " & OLEdr.Item("ho1FirstName")
Dim LogHyperlink As New HyperLink
LogHyperlink = CType(Master.FindControl("LogHyperlink"), HyperLink)
LogHyperlink.Text = "Log Out"
LogHyperlink.NavigateUrl = "Exit.aspx"
When a user logs in successfully the LogHyperlink is changed from Log In to
Log Out and the WelcomeLabel contains the text "Welcome " and person's first name.
This all works fine.
However, the code only works for the Login.asp page. When I navigate to another
page, say About.aspx (which also uses the Site.Master), the Site.Master
page is back to the orginal and I have lost the changes the code made.
Is it possible to make the changes persist for the session across all the
web pages? All the web pages use the Site.Master.
I have included the Site.Master page below.
Thank you.
tfj
<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="Site.master.vb" Inherits="SunriseFarms.Site" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head id="Head1" runat="server">
<title></title>
<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
<style type="text/css">
.style1
{
font-size: medium;
}
</style>
</head>
<body>
<form id="Form1" runat="server">
<div class="page">
<div class="header">
<div class="title">
<h1>
Sunrise Farms <span class="style1">Homeowner's Association</span>
</h1>
</div>
<div class="loginDisplay">
<asp:Label ID="WelcomeLabel" runat="server" Text=""></asp:Label>
<asp:HyperLink ID="LogHyperlink" navigateurl="~/Account/Login.aspx" runat="server">Log In</asp:HyperLink>
</div>
<div class="clear hideSkiplink">
<asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal">
<Items>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home" Selected="True"/>
<asp:MenuItem NavigateUrl="SFDR.pdf" Text="Declaration of Restrictions"
Value="Declaration of Restrictions"></asp:MenuItem>
<asp:MenuItem NavigateUrl="~/HOADues.aspx" Text="HOA Dues" Enabled="True"/>
<asp:MenuItem NavigateUrl="" Text="Violations">
<asp:MenuItem Text="Report A Violation" Value="Report A Violation">
</asp:MenuItem>
<asp:MenuItem Text="View Violations" Value="View Violations">
</asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/>
</Items>
</asp:Menu>
</div>
</div>
<div class="main">
<asp:ContentPlaceHolder ID="MainContent" runat="server"/>
</div>
<div class="clear">
</div>
</div>
<div class="footer">
2014
</div>
</form>
</body>
</html>
tfj 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.