Bug Tracker

Ticket #5034: HistoryPage2.aspx

File HistoryPage2.aspx, 4.8 KB (added by soniad, 12 years ago)
Line 
1<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPageTop.master"
2    CodeFile="HistoryPage2.aspx.cs" Inherits="HistoryPage2" ValidateRequest="false" %>
3
4<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
5    Namespace="System.Web.UI" TagPrefix="asp" %>
6<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
7    <title>Untitled Page</title>
8
9    <script type="text/javascript">
10
11     
12      jQuery(document).ready(function() {
13         pageloadedFirstTime = true;
14          // Initialize history plugin.
15          jQuery.historyInit(pageload);
16          //pageload function is for callback purpose
17          jQuery('[id$=hiddenFieldCurrentContainerType]').val("D");
18         
19
20
21          return false;
22
23      });
24     
25      function LoadDetailPage(screenId, filters, hid) {
26    try {
27        alert(screenId);
28        var ucName = "";
29        if (screenId == 1)
30            ucName = 'ClientDemographic.ascx';
31        else if (screenId == 2)
32            ucName = 'ClientInformation.ascx';
33       
34       
35        if (ucName != "")
36            jQuery.post("Default.aspx?ucName=" + ucName, 'ajaxRequest=true', loadPageCallback);
37        else {
38            var DivShowDetailHTML = document.getElementById("DivShowDetailHTML");
39            DivShowDetailHTML.innerHTML = "";
40        }
41        return false;
42    }
43    catch (Ex) {
44        alert(Ex);
45    }
46
47}
48
49
50function loadPageCallback(result) {
51    try {
52        //Get the PageResponse Object passed through JSON and create an JSON object over here
53        start = result.indexOf("##START##") + 9;
54        end = result.indexOf("##END##");
55        var outputHtml = result.substr(start, end - start);
56        var DivShowDetailHTML = document.getElementById("DivShowDetailHTML");
57        DivShowDetailHTML.innerHTML = outputHtml;
58    }
59    catch (ex) {
60        alert(ex);
61    }
62}
63
64function test() {
65    alert('HI');
66
67}
68
69
70function OpenNewPage(screenId, containerType, filtersData) {
71    alert(screenId);
72    var hash = screenId;
73    hash = hash.replace(/^.*#/, '');
74    // moves to a new page.
75    // pageload is called at once.
76    // hash don't contain "#", "?"
77    var hid = new String();
78 
79
80    if (jQuery('[id$=hiddenFieldCurrentContainerType]').val() == containerType)
81        jQuery.historyLoad(String(parseInt(hid)));
82    else {
83        LoadDetailPage(hash, filtersData, hid);
84    }
85    return false;
86
87}
88
89 var pageloadedFirstTime = false;
90    // PageLoad function
91    // This function is called when:
92    // 1. after calling jQuery.historyInit();
93    // 2. after calling jQuery.historyLoad();
94    // 3. after pushing "Go Back" button of a browser
95  //  jQuery.noConflict();
96    function pageload(hid) {
97
98        if (hid && (!pageloadedFirstTime)) {
99            LoadDetailPage(screenId, filters, hid);
100        } else {
101            // start page
102            jQuery("#DivShowDetailHTML").empty();
103        }
104        pageloadedFirstTime = false;
105
106    }
107
108
109
110
111
112   
113     
114    </script>
115
116</asp:Content>
117<asp:Content ContentPlaceHolderID="ContentPlaceHolderChildContents" runat="server">
118    <div>
119        <center>
120            <span id="Span2" style="font-family: Microsoft Sans Serif; font-size: 10pt; color: #804000;">
121                <b>History Prototype through JQuery.History</b></span></center>
122        <br />
123        <a style="cursor: pointer" onclick="javascript:OpenNewPage('1','D','ClientId=1&DocumentId=20&Version=4');">
124            <font style="font-family: Microsoft Sans Serif; font-size: 8.25pt; color: #804000;">
125                Load Client Demographic</font></a><br />
126        <a style="cursor: pointer" onclick="OpenNewPage('2','D','ClientId=1&DocumentId=21&Version=5');">
127            <font style="font-family: Microsoft Sans Serif; font-size: 8.25pt; color: #804000;">
128                Load Client Information</font></a>
129        <br />
130        <a rel="history" style="cursor: pointer" onclick="OpenNewPage('3','L','ClientId=1&FirstName=Sonia&LastName=Dhamija');">
131            <font style="font-family: Microsoft Sans Serif; font-size: 8.25pt; color: #804000;">
132                Load List Page</font></a>
133        <input type="text" id="textboxTest" runat="server" />
134        <br />
135        <span id="Span1" style="font-family: Microsoft Sans Serif; font-size: 10pt; color: #804000;">
136            <b>Div HTML Container</b></span>
137        <div id="DivShowDetailHTML" style="background-color: #F4F4F4; font-family: Microsoft Sans Serif;
138            font-size: 10px; color: #183490; font-weight: normal;">
139        </div>
140        <input type="hidden" value="" id="hiddenFieldHashValue" />
141        <input type="hidden" id="HiddenPageFilters" runat="server" />
142    </div>
143</asp:Content>