I have the following case:
Page1.aspx
this page has the master page master.aspx
.
I have some code in the master page :
if (!Page.IsPostBack)
{
adjustServiceBar();
}
when i click any button in the Page1.aspx
it enters the !Page.IsPostBack
and execute the method !!
i want this method in the !Page.IsPostBack)
only
One way to do this is to set a session variable and then check that variable to ensure your code will fire only once. Another way is to set a hidden control on your form and play with its text or value property.
According to each scenario the solution may be very complex such as custom derived masterpages and pages that extend the current events functionality to suit your needs.