重构老项目偶然一瞥:
1
if (!PageValidation())
2 {
3 this.Page.ClientScript.RegisterStartupScript( this.Page.GetType(), " ValidationFailed ", " <script type='text/javascript'>alert('页面验证失败,请确认数据输入是否正确!');</script> ");
4 }
2 {
3 this.Page.ClientScript.RegisterStartupScript( this.Page.GetType(), " ValidationFailed ", " <script type='text/javascript'>alert('页面验证失败,请确认数据输入是否正确!');</script> ");
4 }
/// <summary>
/// 验证页面数据,防止非正常提交
/// </summary>
/// <returns></returns>
protected bool PageValidation()
{
//时间不够,暂时不验证了
bool result = true;
return result;
}