如果出现如下错误:
Page.IsValid cannot be called before validation has taken place. It should be queried in the event handler for a control with CausesValidation=True or after a call to Page.Validate.
Page.IsValid cannot be called before validation has taken place. It should be queried in the event handler for a control with CausesValidation=True or after a call to Page.Validate.
在判断Page.IsValid前,加上一句Page.Validate()即可