Decrease Font Size
Increase Font Size
   BLOG

Page.IsValid cannot be called before validation has taken place

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
}

Comments (1) -

  • payday loans

    1/14/2010 5:05:44 PM |

    One that would have the fruit must climb the tree.

Add comment

Loading