|
查看: 1086|回复: 5
|
不懂要怎样解释(asp.net)
[复制链接]
|
|
|
请问各位大大
那个textfield的,没有填资料或写错datatype的,会提示我的
这个叫什么?
要怎样弄? |
|
|
|
|
|
|
|
|
|
|
发表于 20-2-2009 11:00 AM
|
显示全部楼层
原帖由 jackhui 于 19-2-2009 11:10 PM 发表 
请问各位大大
那个textfield的,没有填资料或写错datatype的,会提示我的
这个叫什么?
要怎样弄?
validator? |
|
|
|
|
|
|
|
|
|
|
发表于 20-2-2009 11:06 AM
|
显示全部楼层
有这几种
RequiredFieldValidator
CompareValidator
RangeValidator
RegularExpressionValidator
CustomValidator
ValidationSummary
sample code- <form id="form1" runat="server">
- <div>
- <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
- <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Required!" ControlToValidate="TextBox1">
- </asp:RequiredFieldValidator>
- <asp:Button ID="Button1" runat="server" Text="Submit" CausesValidation="true"/>
- </div>
- </form>
复制代码
http://www.beansoftware.com/ASP.NET-Tutorials/Validation-In-ASP.NET.aspx
[ 本帖最后由 hooi1983 于 20-2-2009 11:10 AM 编辑 ] |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 21-2-2009 10:49 PM
|
显示全部楼层
|
那如果是自动提示,即我没有按submit之类的按钮,系统也会提示,也一样吗? |
|
|
|
|
|
|
|
|
|
|
发表于 22-2-2009 12:30 AM
|
显示全部楼层
没错的话是用 KeyPress event
但我不懂 ASP.Net 有没有,没用过 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 22-2-2009 12:51 AM
|
显示全部楼层
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|