I’m currently learning ASP.NET, and read that the page validation occurs after Page.Load(). When I put
if (Page.IsValid == true) whatever;
then I get an error, even though that line is in my Page_PreRender() event handler.
How does that make sense?
Thanks in advance, just trying to understand it fully.
You either have to have a control that causes validation doing the postback (
CausesValidation="true") or actually callPage.Validate()manually forPage.IsValidto be accessible…otherwise validation hasn’t happened, so there’s just nothing to check, the value would be meaningless, which is the current error you’re seeing.