Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone,
In a .aspx page I have a condition in Page_load event, so that on each postback
this condition is checked,i.e,session.isnewsession(). If the result is false the rest of the page code executes but if the result is true then page stops execution any further event and just renders itself as it was.
Like, If ddl_city has caused the postback, the condition in page_load will be checked. If false the normal execution will carry on. If the result is true then no further control event in that page will fire,not even ddl_city_SelectedIndexChanged.
How can I do it?
So far I've understood that a control's lifecycle can't be broken.
Please suggest.
Posted

You can always add the
C#
HttpContext.Current.ApplicationInstance.CompleteRequest();

it will gracefully complete the request.
 
Share this answer
 
I was thinking Exit Sub, didn't know about the above solution 1
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900