asp.net: what’s the page life cycle order of a control/page compared to a user contorl inside it?

You should look at this ASP.NET Page Life Cycle Overview and this Page: PreInit Control: Init Page: Init Page: InitComplete Page: PreLoad Page: Load Control: Load Page: LoadComplete Page: PreRender Control: PreRender Page: PreRenderComplete Page: SaveStateComplete Page: RenderControl Page: Render Control: RenderControl Control: Unload Control: Dispose Page: Unload Page: Dispose

How to Execute Page_Load() in Page’s Base Class?

We faced the similar problem, All you need to do is just register the handler in the constructor. 🙂 public class FactsheetBase : System.Web.UI.Page { public FactsheetBase() { this.Load += new EventHandler(this.Page_Load); } public MyPageData Data { get; set; } protected void Page_Load(object sender, EventArgs e) { // get data that’s common to all implementors … Read more

ASP.NET: What happens to code after Response.Redirect(…)?

Response.Redirect has an overload accepting a boolean argument that indicates if the call to Response.Redirect should end the response. Calling the overload without this argument is the same as specifying true to indicate that the response should end. Ending the reponse means that Response.End is called after the response has been modified to make the … Read more

What is the difference between Page.IsPostBack and Page.IsCallBack?

Page.IsCallBack It is getting a value indicating whether the page request is the result of a call back. Its a special postback, so a round-trip always occurs; however, unlike the classic postback, the script callback doesn’t redraw the whole page. ViewState is not updated during a callback, it is for postback. Page.IsPostBack Checks whether the … Read more

C# Clear Session

In ASP.NET, when should I use Session.Clear() rather than Session.Abandon()? Session.Abandon() destroys the session and the Session_OnEnd event is triggered. Session.Clear() just removes all values (content) from the Object. The session with the same key is still alive. So, if you use Session.Abandon(), you lose that specific session and the user will get a new … Read more

tech