How to validate the value of TextBox?

The value of the TextBox may not be all the same character. How to validate it?

Thanks,

Jack

0
JackSmith
6/20/2006 7:09:15 PM
asp.net.web-forms 93655 articles. 4 followers. Follow

5 Replies
986 Views

Similar Articles

[PageSpeed] 46

It depends on what kind of validation you are trying to do. There are some validators available with the framework. Check them out. you can also use a customvalidator and use regular expressions.
***********************
Dinakar Nethi
Life is short. Enjoy it.
***********************
0
ndinakar
6/20/2006 8:43:09 PM

I want to use regular expression. If the user happened to type "aaaaaaaaaaaaaaaaaaaaa" that is invalid. How to set the expression?

Thanks.

0
JackSmith
6/21/2006 12:39:55 PM

Can you be more specific??
What do you want this validator to do??

 


Please remember to "Mark As Answer" if this post answered your question!

Bilal Shouman - MCAD.NET

|My Blog|
---------------------------------


0
JRICE
6/21/2006 1:14:41 PM
There is a textbox on the page to collect user's comments. The user types characters into the textbox. If the user happened to push a key, such as the key "A", for a while on the keyboard, then "aaaaaaaaaa" will be displayed in the textbox. This kind of input value will be considered invalid. The validator should give the error message to remind the user's invalid input. That is what I want the validator to do.
0
JackSmith
6/24/2006 2:41:06 AM
If you know how to write the regular expression then you can just use a RegularExpressionValidator control to validate your textbox.

Hope it helps,

Joe

http://www.joeaudette.com
http://www.mojoportal.com
0
joeaudette
6/24/2006 2:59:31 AM
Reply:

Similar Artilces:

validate Textbox in Web User Control from web form?
ASP.NET 2.0 I have a web user control that contains a textbox.  I need to add some validation (like requiredfieldvalidator, comparevalidator, etc). I would normally add the validator to my web user control by placing the validator next to my textbox.  However, I need the validation message somewhere else on my web form, not near the user control. So how would I associate a validation control on my web form with the text box inside my web user control?  Can this be done; any alternatives out there? Thanks!   The error message should occur wherever you place the vali...

C#.NET WEB APPLICATION
hei guys, i need help on my application, i'm using C#.NET as front-ed and SQL as back-end, aside from a datagrid, i want to display my data using textboxes and not a datagrid, i can do it using Visual Basic 6 but since i'm a newbee at C#.NET i don't know how to do it, specially the codes, can anyone help me with it? thank you in advance! If you are doing windows development, i would suggest using 'DataForm wizard' (Use Solution Explorer-->Rightclick project-->Add new Item-->New DataForm). It will guide you through steps. If you are doing web apps. Use quickstart to learn them. h...

Passing Values from a Web Form to Another Web Form
Hello All! I am trying to pass values from one web form to another web form. I know that there are 3 ways of doing this: queryString, Server.Transfer and Session. I am using the Server.Transfer method. But I am not able to create, in my 2nd web form, an instance of my 1st web form. My 1st Web form is named CallTrack.aspx and my 2nd is named Export.aspx. What I mean is something like this: Public value as CallTrack. I can't create it in my 2nd web form because when the intellisense is displayed, there's no CallTrack in the options. Thanks!   How about using cross-...

form textboxes: How to programmically Validate the values
 Hi, I changing a form with lots of textboxes for the user to enter the profile information. I databinded each of the textbox to the profileobject. In Windows form, when you leave or change the textbox values, you can call the property to set the value. How do I do that with web form where the set call in each property of the profile object? Or programmically call a method to validate all the textbox values? Any help is appreciated by this newbie,Thanks.    protected void SubmitButton_Click(Object sender, EventArgs e)  {      Label ...

Implementing .Net Form into an APS.net web form, can this be done
I am new here, but have been searching for a while, and may not have the correct lingo to find what I am looking for.  I am tasked with implementing a .exe application that was writen vb6 then converted to .net into a new website my team is developing. The idea is to put each of the 3 different forms in this .exe application of 3 different .aspx pages. I have attempted multiple things to get this into the page and even started to just rewrite it as an ASP.net web form, but even then I can't reuse any of the code since the System.Web.UI.Page doesn't inherit the sa...

passing values to .net web form application
Hi Can any explain me abt how to pass values to my .NET web form application (designed using PB 11.1) from other web application? My intension is to redirect from a web application (ASP.NET to .net web form application) to my web application with user information. Thanks & Regards, Anbazhagan From the "Deploying Applications and Components to .NET" manual: >>> Starting an application with command line parameters If your application requires command line parameters, you can assign values to the PBCommandParm global property before you deploy the...

How to change the value of a TextBox inside a Web Form in Insert mode?
Hi, If the textbox txtDate is outside a Web Form, we can change the values as follow: txtName.Text = "James"; If the item is inside a Web Form in Insert mode, how can I change the TextBox value by using .net script or JavaScript at run-time?  Thanks, James Hi James,If I understand your question, you want to be able to change the value using JavaScript within the browser, not the code-behind.  You would do that with something like this:<script language="javascript" type="text/javascript">document.getElementById(<%=txtName.ClientID.ToStr...

Send e-mail with web form values (vb.net)
I'm sure this is very simple but;I have a form with numerous (<50) textbox controls and related Label controls; ie: <asp:Label ID="Label1" runat="server" Text="Last Name: "></asp:Label> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>When the form is submitted I want to loop through each label control and textbox control and get their Text values for the e-mail without specifying each control. Anyone have suggestions on the best way to do this?Any assistance appreciated greatly!   Here is a solution for you in VB.net:http://www.extremeexperts.com/...

validate web form entries via textbox again in the C# (code-behind) code again
I have requiredfieldvalidators, comparevalidators and a regualarexpressionvalidator for the email on my login form for the textboxes. My question is do I have to check in the C# to make sure the textboxes have values and if so what does a experienced programmer think of my code. What would you change??? Are the if statements the way to go??? Thanks for making me a better coder................newbieprotected void LoginButton_Click(object sender, EventArgs e){string emailAddress = String.Empty;string password = String.Empty;if (!String.IsNullOrEmpty(TextBoxEmailAddress.Text)){emailAddress = Te...

Passing Web Form TextBox value to a SQL Server 2000 Table column field
Community, I am trying to pass a text box value to populate a table column called LastName - see below - using the Update command.  When the below code executes from the Web Form, 'LastName.Text' populates the table column.  I, of course, want the value in the txtLastName.Text field.  Any advice is appreciated! Dim strSQL As New SqlCommand("UPDATE Clients" & _ " SET LastName = 'txtLastName.Text' " & _ " WHERE AccountID =" & txtAccountNo.Text, scnnNW) Rob H. Change: " SET LastName = 'txtLastName.Text' " & _ to " SET LastName...

HTML textboxes appear but not web form textboxes
Hi all, I'm new to all this VS.net and I tested it by creating a new project, and clicking and dragging an asp textbox onto the aspx page. Upon clicking "Build and Browse" the asp textbox does not appear at all. So I double checked, and yeah, Visible was set to true. So I tried clicking and dragging a normal textbox and strangely, the html textbox does appear on the screen. Please help on how I can make the ASP textbox appear. I constructed a webform entirely of ASP textboxes and ASP buttons and nothing on the page appears. Is there anything I need to add/remove on the con...

Clearing Web Controls Values from a Web Form
I have a web form and after a user submit it I want to clear the form so that they may submit another entry. I have seen examples in VB of how to loop thru a web form and clear the controls, but I need a C# solution. I have tried the following code, while it does not give me an error, it does not clear the controls on the form. Any suggestions? Thanks! foreach (Control parent in Page.Controls)         {             foreach (Control child in parent.Controls)           ...

windows forms in vb .net into web forms
we are creating a database driven website as part of our project. currently we have forms connecting to the database created in visual basic. these windows forms we need to convert into web forms which are asp .net compatible. can u give me an answer or show me a way. Hi, because of the difference in nature between web and win applications you'll need to reimplement at least the UI part. If you have a multitiered application in which the busines logic and data access are in different parts/assemblies you can reuse them. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Wor...

getting values from a web form to windows form
Hot Requirement ..... Is there any possible of getting values from a web form to windows form ????? Yes One way i to use the WebRequest and WebResponse classes of the System.Net namespace. For example:  WebRequest request = WebRequest.Create("URL of the web page); WebResponse response = request.GetResponse(); StreamReader reader = new StreamReader(response.GetResponseStream()); string content = reader.ReadLine(); ....    Reza Nassabehwww.professionalcsharp.comDon't forget to click "Mark as Answer" on the post that helped you. That way fut...

Need to validate the Textbox value with database columm value
Working with ASP.NET 2.0 i have a textbox say txt1 for entering the date and a column in database for date.I need to validate the txt1 vaalue with the database value ,if txt1 date doesn't exist in the database i want to warn the user (Date doesnt Exist) either on textbox change event or on button click.How can i do this..... I would have a textbox, a label and a button. Then on the onClick event handler for the button I would have the code where the search in the DB is being made and if I receive any rows, modify the Text property of the label to say something like "Date exists&q...

Web resources about - How to validate the value of TextBox? - asp.net.web-forms

Credit Card Validate on the App Store on iTunes
Get Credit Card Validate on the App Store. See screenshots and ratings, and read customer reviews.

Who Is Going to Shoot Obama? Paul Broun Chuckles, Validates Question - YouTube
Republican Congressman from George Paul Broun chuckles and does not even come close to denouncing a question asked by a constituent at a town ...

PM says MH370 debris find 'validates search'
Experts say recovered MH370 debris is consistent the area being searched in the southern Indian Ocean.

Spain's domination of England validates the Socceroos' search for identity
It is incredible to think that with all the billions of dollars of resources in the English game, their solitary success remains almost 50 years ...

Fracking report validates environmental concerns in N.W.T.
... Kenyon of the Pembina Institute. A director of the Pembina Institute in Edmonton says a new report on the risks of shale gas development validates ...

【medical-news】Study First to Validate That Singing Can Help People Learn a Foreign Language - 医药生命科学动态跟踪 ...
只是新闻而已Fernanda Ferreira’s family emigrated from Portugal to Canada when she was very young. There, like most Canadian children, she learned French ...

Supreme court validates private loans for rightful purposes
Supreme court validates private loans for rightful purposes

IXIA : Selected by China Network World to Validate High-Performance Cisco ...
IXIA : Selected by China Network World to Validate High-Performance Cisco ... 4-traders (press release) BEIJING - June 25, 2013 - Ixia (Nasdaq: ...

Apple Watch uses constant skin contact to validate Apple Pay purchases
... will the device make sure payments via Apple Pay are secure? Both the iPhone 6 and iPhone 6 Plus have the convenient Touch ID sensor to validate ...

Like You Really Need To Validate Your Social Media Presence….
How many Fortune 500 companies are blogging and using social media, and what can law firms learn from them?

Resources last updated: 11/24/2015 2:53:48 PM