如何在ASP.net中验证文本框? [英] How to validate a textbox in ASP.net?

查看:93
本文介绍了如何在ASP.net中验证文本框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在客户端使用Java脚本验证文本框时,我需要帮助.请帮助我..

I need help on validating a text box using java script at client side. Plz help me..

推荐答案

尝试在验证文本框 [如何问一个好问题? [ ^ ]
Try search on google[^].

A simple search here can solve your problem in quick time for sure.

This search shows 4,490,000 results, and many of those search result threads will surely solve your problem.

Try this thread: Validate TextBox[^]

and don''t ask question like validating text box.
Be specific!
Specify exactly what it is you need help with.

Refer: How to ask a good question?[^]


如果您正在开发ASP.net网站,请尝试此链接
http://forums.asp.net/t/1356162.aspx/1 [ ^ ]
Try this link if you are developing an ASP.net website
http://forums.asp.net/t/1356162.aspx/1[^]


<form id="form1" runat="server">
    Your name:<br />
    <asp:TextBox runat="server" id="txtName" />
    <asp:RequiredFieldValidator runat="server" id="reqName" controltovalidate="txtName" errormessage="Please enter your name!" />
    <br /><br />
    <asp:Button runat="server" id="btnSubmitForm" text="Ok" />
</form>




使用必需的字段验证器和有效的表达式验证器

http://asp.net-tutorials.com/validation/required-field-validator/ [ ^ ]


http://asp.net-tutorials.com/validation/regular-expression-validator/ [ ^ ]




use required field validator and regualar expression validatior

http://asp.net-tutorials.com/validation/required-field-validator/[^]


http://asp.net-tutorials.com/validation/regular-expression-validator/[^]


这篇关于如何在ASP.net中验证文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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