This is the control structure
ContentPlaceHolder
--> Wizard
--> Panel
I am using setTimeout to display the panel after x minutes.
How do I get the ClientID of the panel?
The line of javascript needed is something like:
setTimeout(displayExtendSession('<%= ExtendSession.ClientID %>', 600000);
aspx
<asp:Content ID="Content1" runat="server" ...>
<asp:Wizard ID="wizard1" runat="server" ... >
<asp:Panel ID="ExtendSession" runat="server">
<asp:Label ID="ExtendSessionLifePrompt" runat="server" Text="Your session is going to expire in 1 minute. Would you like to extend your Session?"></asp:Label>
<asp:Button ID="ExtendSessionLife" runat="server" Text="Yes" />
<input type="button" id="CancelExtendSessionLife" value="No" onclick="HideExtendSession('<%= ExtendSession.ClientID %>'); return false;" />
</asp:Panel>
</asp:Wizard>
</asp:Content>
javascript
function HideExtendSession(msgBox) {
if (msgBox)
document.getElementById(msgBox).style.display = "none";
}
function DisplayExtendSession(msgBox) {
if (msgBox)
document.getElementById(msgBox).style.display = "block";
}
setTimeout(DisplayExtendSession('<%= ExtendSession.ClientID %>', 600000);
setTimeout(HideExtendSession('<%= ExtendSession.ClientID %>', 720000);