Thanks for the feedback James, but unfortunately I cannot post a link. It's a private website and is protected. You wouldn't be able to get in.
But here's some of the code:
This is the first page (the one that works the first time but doesn't work when you go back to it via the back button):
Code:
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Learning.Master" CodeBehind="SelectCourse.aspx.cs" Inherits="AHSLearning.SelectCourse" %>
<%@ Register Src="~/SelectCourseControl2.ascx" TagName="SelectCourseControl2" TagPrefix="uc" %>
<%@ Register Src="~/KeyInitiativesControl.ascx" TagName="KeyInitiativesControl" TagPrefix="uc" %>
<%@ Register Src="~/ResourcesControl.ascx" TagName="ResourcesControl" TagPrefix="uc" %>
<%@ Register Src="~/EducatorsCornerControl.ascx" TagName="EducatorsCornerControl" TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link type="text/css" rel="stylesheet" href="CSS/SelectCourse.css" />
<link type="text/css" rel="stylesheet" href="CSS/SelectCourseControl2.css" />
<link type="text/css" rel="stylesheet" href="CSS/KeyInitiativesControl.css" />
<link type="text/css" rel="stylesheet" href="CSS/EducatorsCornerControl.css" />
<link type="text/css" rel="stylesheet" href="CSS/ResourceControl.css" />
<link type="text/css" rel="stylesheet" href="CSS/quadrant.css" />
<script type="text/javascript" src="Scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="Scripts/jquery-ui-1.10.4.custom.min.js"></script>
<script type="text/javascript" src="Scripts/Application.js"></script>
<script type="text/javascript" src="Scripts/CoursesPage.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<table id="CourseTable" class="CourseTable" border="0">
<tr class="Header">
<td id="TopLeftCell" valign="top"><uc:SelectCourseControl2 id="SelectCourseControl2" runat="server" /></td>
<td id="TopRightCell" valign="top"><uc:KeyInitiativesControl id="KeyInitiativesControl" runat="server" /></td>
</tr>
<tr class="Header">
<td id="BottomLeftCell" valign="top"><uc:ResourcesControl id="ResourcesControl" runat="server" /></td>
<td id="BottomRightCell" valign="top"><uc:EducatorsCornerControl id="EducatorsCornerControl" runat="server" /></td>
</tr>
<%-- <tr>
<td colspan="2" style="text-align: left;">
<img src="Images/SocialNetworkLinks.png" border="0" align="right" />
<br />
<hr />
<span align="left">Version 0.3</span>
</td>
</tr>--%>
</table>
<asp:HiddenField ID="PageNameHiddenField" ClientIdMode="Static" Value="SelectCourse" runat="server" />
<script type="text/javascript">
$(function ()
{
LearningApp.CoursesPage("<%=UniqueID%>");
});
</script>
</asp:Content>
Here is the second page:
Code:
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Learning.Master" CodeBehind="SelectCourseType.aspx.cs" Inherits="AHSLearning.SelectCourseType" %>
<%@ Register Src="~/SelectCourseControl2.ascx" TagName="SelectCourseControl2" TagPrefix="uc" %>
<%@ Register Src="~/SelectCourseTypeControl.ascx" TagName="SelectCourseTypeControl" TagPrefix="uc" %>
<%@ Register Src="~/ResourcesControl.ascx" TagName="ResourcesControl" TagPrefix="uc" %>
<%@ Register Src="~/OutcomesControl.ascx" TagName="OutcomesControl" TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link type="text/css" rel="stylesheet" href="CSS/SelectCourse.css" />
<link type="text/css" rel="stylesheet" href="CSS/SelectCourseControl2.css" />
<link type="text/css" rel="stylesheet" href="CSS/SelectCourseTypeControl.css" />
<link type="text/css" rel="stylesheet" href="CSS/OutcomesControl.css" />
<link type="text/css" rel="stylesheet" href="CSS/ResourceControl.css" />
<link type="text/css" rel="stylesheet" href="CSS/quadrant.css" />
<script type="text/javascript" src="Scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="Scripts/jquery-ui-1.10.4.custom.min.js"></script>
<script type="text/javascript" src="Scripts/Application.js"></script>
<script type="text/javascript" src="Scripts/CoursesPage.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<table id="CourseTable" class="CourseTable" border="0">
<tr class="Header">
<td id="TopLeftCell" valign="top"><uc:SelectCourseControl2 id="SelectCourseControl2" runat="server" /></td>
<td id="TopRightCell" valign="top"><uc:SelectCourseTypeControl id="SelectCourseTypeControl" runat="server" /></td>
</tr>
<tr class="Header">
<td id="BottomLeftCell" valign="top"><uc:ResourcesControl id="ResourcesControl" runat="server" /></td>
<td id="BottomRightCell" valign="top"><uc:OutcomesControl id="OutcomesControl" runat="server" /></td>
</tr>
<%-- <tr>
<td colspan="2" style="text-align: left;">
<img src="Images/SocialNetworkLinks.png" border="0" align="right" />
<br />
<hr />
<span align="left">Version 0.3</span>
</td>
</tr>--%>
</table>
<asp:HiddenField ID="PageNameHiddenField" ClientIdMode="Static" Value="SelectCourseType" runat="server" />
<script type="text/javascript">
$(function ()
{
LearningApp.CoursesPage("<%=UniqueID%>");
});
</script>
</asp:Content>
They both use the same javascript:
Code:
LearningApp.CoursesPage = function (pageID)
{
var _data;
_pageID = pageID;
/*
Populates the Courses menu item.
*/
var PopulateCoursesMenu = function (callback, callback2)
{
// Get all the user's courses
LearningApp.doCallback(pageID,
{
command: "GetCourses"
},
function (data)
{
_data = data;
...
});
}
}
If I put a break point at LearningApp.doCallback(pageID,
it gets hit every time (first page, second page, and back to the first page).
If I put a break point in the callback here: _data = data;
it gets hit when I load the first page for the first time, the second page, but not the first page when I hit the back button.
There are two ajax handlers, one per page, and they happen to be the C# codebehind of each page. I put a breakpoint in both and the first one gets hit when I visit the first page for the first time, the second one gets hit when I go to the next page, and neither get hit when I return to the first page via the back button.
Bookmarks