An exception of type 'System.Web.HttpException' occurred in System.Web.dll but was not handled in user code Additional information: Page.IsValid cannot be called before validation has taken place. It should be queried in the event handler for a control that has CausesValidation=True and initiated the postback, or after a call to Page.Validate.
Solution: call the Page.Validate() before the Page.IsValid
if (!isValidated)
{
Page.Validate();
}
if (Page.IsValid)
{
//do something here
}