handle event before Page_Load

zkent picture zkent · Dec 17, 2008 · Viewed 18.3k times · Source

I have an asp.net web page with a ton of code that is handled in the Page-Load event of the page. I also have a dropdown box on the page that should reload the page with a new value, but I would like to get this new value before I process the entire Page-Load code. I am trying to get my head around ASP.NET page lifecycle.

Should I move the Page-Load code to a later event or is there a way to get the value of the dropdown list value before the the Page-Load event begins?

TIA

Answer

Martin Moser picture Martin Moser · Dec 17, 2008

I would use Page_PreLoad instead of Page_Init, because it is raised after all postback data is processed.