Be seen. Boost your question’s priority for more expert views and faster solutions
DEFAULT PAGE SOURCE:
<%@ Page Language="C#" MasterPageFile="~/MimeMaster01.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="leftnav" Runat="Server">
<ajaxext:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
</ajaxext:ScriptManagerProxy>
<center>
<asp:HyperLink ID="hypContacts" runat="server" CssClass="hypLink" NavigateUrl="~/Miscellaneous/Contacts.aspx" >Contacts</asp:HyperLink>
</center>
<br />
<br />
<ajaxext:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<center>
<asp:Calendar ID="calEvents" runat="server" BackColor="White" BorderColor="#999999"
CellPadding="4" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
ForeColor="Black" Height="180px" Width="200px" OnSelectionChanged="calEvents_SelectionChanged">
<SelectedDayStyle BackColor="#ffc0cb" Font-Bold="True" ForeColor="White" />
<TodayDayStyle BackColor="#ffc0cb" ForeColor="Black" />
<SelectorStyle BackColor="#CCCCCC" />
<WeekendDayStyle BackColor="#CD8C95" />
<OtherMonthDayStyle ForeColor="#808080" />
<NextPrevStyle VerticalAlign="Bottom" />
<DayHeaderStyle BackColor="#ffb6c1" Font-Bold="True" Font-Size="7pt" />
<TitleStyle BackColor="#ffc0ca" BorderColor="Black" Font-Bold="True" />
</asp:Calendar>
</center>
<br />
<center>
<h5 class="h5header" >Events for the day:</h5>
<asp:ListBox ID="lbxEvents" runat="server" CssClass="listbox" ></asp:ListBox>
</center>
</ContentTemplate>
</ajaxext:UpdatePanel>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="righnav" Runat="Server">
<h3>Welcome!</h3>
<p>This is the administration site of Marriage Encounter (ME) - Western Cape. Access is restricted to ME members who are a part of the administration team. If you are a team member but do not have access, please contact the Administrator (click the "Contacts" link in the left pane to be taken to our contacts page) and request the necessary clearance.</p>
<br />
<p><i>The Admin Team!</i></p>
</asp:Content>
DEFAULT PAGE CODE BEHIND:
using System;
using System.Data;
using System.Text;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BusinessLogic;
using DataTransferObjects;
public partial class _Default : System.Web.UI.Page
{
private List<ME_Event> dailyEvents;
private bool loggedIn;
protected void Page_Load(object sender, EventArgs e)
{
bool needToCallEvents;
needToCallEvents = false;
if (Request.Browser.MSDomVersion.Major == 0) // Non IE Browser?)
Response.Cache.SetNoStore(); // No client side cashing for non IE browsers
// Load the Page-specific stylesheet.
HtmlLink lnk = (HtmlLink)Master.FindControl("cssLink");
if (lnk != null)
lnk.Href = "~/CSS/Default.css";
if (Page.IsPostBack)
{
if (Session["loggedIn_Session"] != null)
{
if ((bool)Session["loggedIn_Session"] != User.Identity.IsAuthenticated)
{
loggedIn = User.Identity.IsAuthenticated;
Session["loggedIn_Session"] = loggedIn;
FetchDailyEvents();
}
else
{
loggedIn = (bool)Session["loggedIn_Session"];
dailyEvents = (List<ME_Event>)Session["dailyEvents_Session"];
lbxEvents.DataSource = dailyEvents;
lbxEvents.DataBind();
calEvents.VisibleDate = calEvents.SelectedDate;
}
}
else
{
loggedIn = User.Identity.IsAuthenticated;
Session["loggedIn_Session"] = loggedIn;
FetchDailyEvents();
}
}
else
{
// Not PostBack
needToCallEvents = false;
if (Session["loggedIn_Session"] != null)
{
if ((bool)Session["loggedIn_Session"] != User.Identity.IsAuthenticated)
{
loggedIn = User.Identity.IsAuthenticated;
Session["loggedIn_Session"] = loggedIn;
needToCallEvents = true;
}
else
{
loggedIn = (bool)Session["loggedIn_Session"];
}
if (Session["selectedDate_Session"] != null)
{
calEvents.SelectedDate = (DateTime)Session["selectedDate_Session"];
calEvents.VisibleDate = calEvents.SelectedDate;
}
else
{
calEvents.SelectedDate = calEvents.TodaysDate;
calEvents.VisibleDate = calEvents.SelectedDate;
}
}
else
{
loggedIn = User.Identity.IsAuthenticated;
calEvents.SelectedDate = calEvents.TodaysDate;
needToCallEvents = true;
}
FetchDailyEvents();
}
}
protected void calEvents_SelectionChanged(object sender, EventArgs e)
{
FetchDailyEvents();
}
private void FetchDailyEvents()
{
lbxEvents.DataSource = "";
dailyEvents = null;
if (loggedIn)
{
dailyEvents = BusinessLogic.Business.GetEvents(calEvents.SelectedDate, "Y");
}
else
{
dailyEvents = BusinessLogic.Business.GetEvents(calEvents.SelectedDate, "N");
}
lbxEvents.DataSource = dailyEvents;
lbxEvents.DataTextField = "Title";
lbxEvents.DataValueField = "Id";
lbxEvents.DataBind();
Session["selectedDate_Session"] = calEvents.SelectedDate;
calEvents.VisibleDate = calEvents.SelectedDate;
Session["dailyEvents_Session"] = dailyEvents;
}
}
MASTER PAGE SOURCE:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MimeMaster01.master.cs" Inherits="MimeMaster01" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Mime Master</title>
<link id="cssLink" rel="stylesheet" type="text/css" runat="server"
href="CSS/Mime.CSS" />
</head>
<body id="MasterBody" runat="server" >
<form id="form1" runat="server" style="height: 100%;">
<div id="container" >
<a name="theTop" ></a>
<div id="header">
<!-- Header start -->
<ajaxext:ScriptManager ID="scriptmanager1" runat="server">
</ajaxext:ScriptManager>
<asp:LoginName ID="lgUser" runat="server" CssClass="loginName" FormatString="Member: {0}"/>
<center>
<h1>Marriage Encounter - Western Cape</h1>
<h5>(Administration Management)</h5>
</center>
<asp:Label ID="lblFollowup" runat="server" CssClass="followup" Visible="false">** Follow-ups Outstanding **</asp:Label>
<asp:Image ID="headerPict" runat="server" CssClass="headerPic" ImageUrl="~/Graphics/ME05.Gif" />
<center><ul id='menu' style="width: 67%">
<li ><a href='<%=ResolveUrl("Default.aspx")%>' id='menuHome' >Home</a></li>
<li ><a href='<%=ResolveUrl("Default2.aspx")%>' id='menuPeople' >People</a></li>
<li ><a href='<%=ResolveUrl("Default2.aspx")%>' id='menuCircles' >Circles</a></li>
<li ><a href='<%=ResolveUrl("Default2.aspx")%>' id='menuWeekends' >Weekends</a></li>
<li ><a href='<%=ResolveUrl("Default2.aspx")%>' id='menuEvents' >Events</a></li>
<li ><a href='<%=ResolveUrl("Default2.aspx")%>' id='menuGeneral' >General</a></li>
<li ><a href='<%=ResolveUrl("Default2.aspx")%>' id='menuPortfolios' >Portfolio</a></li>
<li ><a href='<%=ResolveUrl("Default2.aspx")%>' id='menuUsers' >Users</a></li>
</ul>
<asp:LoginStatus ID="logOn" runat="server" CssClass="loginStat" />
<!-- Give a little space -->
<div style="height:15px"></div>
<hr width="96%" class="redline"/>
</center>
<!-- Header end -->
</div>
<div id="body">
<!-- Body start -->
<div id="dummy" style="position:relative; height: 40px"></div>
<div id="wrapperDiv" class="wrapper">
<div id="left" class="leftnav">
<asp:ContentPlaceHolder ID="leftnav" runat="server">
</asp:ContentPlaceHolder>
</div>
<div id="right" class="rightnav">
<asp:ContentPlaceHolder ID="righnav" runat="server">
</asp:ContentPlaceHolder>
</div>
<!-- <div id="wrapper"> -->
</div>
<!-- Give a little space -->
<div style="height:45px"></div>
<!-- Body end -->
</div>
<div id="footer">
<!-- Footer start -->
<center><hr width="75%" class="redline" /></center>
<!-- Give a little space -->
<div style="height:10px"></div>
<center><a href="#theTop" class="anchor" >Back to top</a></center>
<br />
<center>Marriage Encounter Western Cape ® is a registered trademark of Marriage Encounter Western Cape, Inc<br />
© 2009 Marriage Encounter Western Cape, Inc.
</center>
<!-- Footer end -->
</div>
<!-- Div: "Container" end -->
</div>
</form>
</body>
</html>
MASTER PAGECODE BEHIND:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class MimeMaster01 : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
Because you have everytihng witihin updatepanels (AJAX), the partial postbacks of the page is not cached by the browser. So when you go back to a page which had a partial postback earlier, the changed values will not be seen because the browser cache just has the content that was stored when the page was first shown
Rejo