如何在单个aspx页面中创建登录和注册表单 [英] How to make login and signup forms in single aspx page

查看:115
本文介绍了如何在单个aspx页面中创建登录和注册表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开发两种形式

1.)登录表单id =form1

2.)注册表单id =form2
$ b单个aspx页面中的$ b



我尝试过:



i在单页中制作了这两种形式,但是当我点击注册按钮并尝试注册用户时,它也提供了验证以填写登录表单。但没有显示特殊错误。只是验证登录用户名文本框。

有什么解决方案吗?

i wanna develop two forms
1.) login form id="form1"
2.) registration form id="form2"
in a single aspx page

What I have tried:

i made these two forms in single page but when i clicked register button and tried to register user it gives validation to fill login form also. but showing no special error. just validating the login username textbox.
is there any solution?

推荐答案

Googleasp.net验证组。您所做的是将验证控件添加到组,因此您的登录验证控件位于一个组中,而另一个组中的寄存器表单验证。那样.net只会激活相关组中的验证。如果你谷歌你会找到示例代码。



此链接显示如何设置



指定验证组 [ ^ ]
Google "asp.net validation group". What you do is add your validation controls to "groups", so your login validation controls are in one group and the register form validation in the other group. That way .net will only fire the validation in the relevant group. If you google you'll find sample code.

This link shows you how to set it up

Specifying Validation Groups[^]


这篇关于如何在单个aspx页面中创建登录和注册表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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