Last post Sep 19, 2017 06:00 AM by Eric Du
Sep 18, 2017 09:52 AM|hamej|LINK
I have a web forms page with some controls. I call this form/page with a parameter as a key to data. I set the controls on the page with data in the Page_load event, and it looks fine. But when I make a Postback by clicking a button or a link, I receive
an empty page. What do I do wrong? Should I not do it in the Page_Load event?
Sep 19, 2017 04:28 AM|hkholakiya|LINK
Did you checked "IsPostBack " property in page_load?
Please check it before set your control values.
Sep 19, 2017 06:00 AM|Eric Du|LINK
Through your description, it sounds like that postback cause the control value is null, please check the following code:
//if is not the first post, it will initial the control then set value}else
//if post the form, it will execute the following code }
Understanding The Complete Story of Postback in ASP.NET: