服务器端验证的CreateUserWizard [英] Server-side validation for CreateUserWizard

查看:123
本文介绍了服务器端验证的CreateUserWizard的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是内置的asp.net成员资格的框架。我创建了一个注册页面,建立客户端验证了一些自定义的验证,通过jQuery的AJAX验证到Web服务和客户端验证工作正常。我有两个问题:

I am using the built-in asp.net membership framework. I created a registration page and set up client-side validation with some custom validators, validating through jQuery AJAX to a web service and the client-side validation works ok. I have two issues:

  1. 即使在客户端验证失败,则继续按钮仍然有效。如何禁用呢?

  1. Even when the client-side validation fails, the continue button still works. How do I disable it?

我不想依靠客户端验证。我该如何去实现服务器端验证中的CreateUserWizard?你可以在一些特定的教程指向我?我没能找到一个。

I don't want to count on client-side validation. How do I go about implementing server-side validation in the CreateUserWizard? Can you point me at some specific tutorial? I failed to find one.

感谢您!

推荐答案

使用事件<一href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.createuserwizard.creatinguser.aspx"相对=nofollow> CreatingUser

标记:

<asp:CreateUserWizard runat="server" CreatingUser="wizard_CreatingUser" />

code:

Code:

protected void wizard_CreatingUser (object sender, LoginCancelEventArgs e)
{
    e.Cancel = ((CreateUserWizard)sender).UserName.Contains("!@#$%^&");
}

这篇关于服务器端验证的CreateUserWizard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆