I am working on website using ASP.Net C# WebForms Framework 3.5
I am using Master page for design, and inside Master page I have two user Controls for Header & Footer.
When a user logs in, in Header Control, there is a link to Logoff and onClick event we have written logoff code in cs file.
When we click it, .net will call WebForm’s page_load event, then master pages’s page_load event, then page_load events of all user controls used in master page and then finally the click event will be called.
How can we avoid this? I want to avoid page_load events.
asp.net architecture works like that .you cant change that.
But you can follow a different approach.
Instead of postback when you click on a button you can call a Webserivice directly from the client side(from javascript).
Or you need to follow asp.net MVC.