page-init

Check Session variable and Redirect to login page before page load

坚强是说给别人听的谎言 提交于 2019-11-30 21:05:49
问题 How can I check a variable and redirect to another page before the page loads using ASP.NET? I'm aware of the life cycle, and PageInit() sounds like it would be right, but I can't seem to find anywhere to put the code without and error within Visual Studio. I can't put the onpageinit="" within the first line of my page declaration. Am I suppose to put it somewhere different? My page declaration looks like: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="dashboard.aspx.cs" Inherits=

jQuery Mobile - binding to pageinit event

只愿长相守 提交于 2019-11-28 00:57:02
I am trying to understand the following jQuery Mobile example. $( '#aboutPage' ).live( 'pageinit',function(event){ alert( 'This page was just enhanced by jQuery Mobile!' ); }); What is #aboutPage in this context? What is the object pageinit is binding to? aboutPage should be the id of the page.(i.e.div with data-role="page" ). live() attaches the funcion you have defined which contains the alert to the pageinit event of aboutPage . pageinit is triggered on a page when the page is initialized. So in short What your code does is it will execute the alert statement when aboutPage is initialized