Which validation control to use to control input textbox text length ?

I have a formview to insert record and I want one field to limit to text char length of 50.

Which validation control I should use and how to set it ?

Thanks


Thanks in advance for the help. I will try to credit the ones who helped but most important is we really do sincerely thanks to all who have helped.
0
hkbeer
10/20/2008 1:03:46 AM
asp.net.web-forms 93655 articles. 6 followers. Follow

3 Replies
840 Views

Similar Articles

[PageSpeed] 34

Check this link..

http://www.codeproject.com/KB/aspnet/Textarea_Length_Validator.aspx

Edit:

If it is normal single line TextBox, you can set "MaxLength"..Check this code..  

    <asp:FormView runat="server" ID="formView1" > 
        <ItemTemplate>
            <asp:TextBox ID="TextBox1" runat="server" MaxLength="50"></asp:TextBox>
        </ItemTemplate>
    </asp:FormView>
      

My Blog


"Don't be afraid to be wrong; otherwise you'll never be right."
0
budugu
10/20/2008 2:26:30 AM

I have no idea about formview but you can set particular control maxlength properties to 50

 

Mark Answer If it Helps

0
sarath_cs_8184
10/20/2008 2:30:31 AM

Yes this solves the problem. Thanks


Thanks in advance for the help. I will try to credit the ones who helped but most important is we really do sincerely thanks to all who have helped.
0
hkbeer
10/20/2008 8:16:25 AM
Reply:

Similar Artilces:

Fix broken text wrapping and control input text length in TextBox control
Hi! I'm developing a(nother; it's my second!) ASP.NET application that right now is giving me fits. On one of my screens, the user needs to be able to enter large amounts of text into three database fields. The database fields are all char(350). I'm having two problems with this. First of all, I found that when editing an existing record, text in the fields would wrap in a manner similar to this: Wow, what a sorryperformance! The text box is much wider than the text "Wow, what a sorry", so I couldn't figure out why the text was wrapping. I tried setting the Columns property to 90 (which...

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...

Use Web Control In a Web Control
Is this possible?I am working with an aspx page that consists of many different web controls.One of the web controls contains search criteria.  One of the criteria is a date range where I am trying to add a popup calendar --> which is another web controlCan I register the popupcaledar control on the questionaire control?  I have tried, but nothing seems to be registered.Any ideas will GREATLY help.Relax and have some Home Brew!Prosecute the Owner - Don't PERSECUTE the Breed!Breed Specific Legislation targets the WRONG end of the LEASH! Without seeing your code we can'...

Use 1 control validator to multiple textbox control
How can i set my validation control to be used by multiple textboxes. The logic is something like this. <asp:TextBox ID="TextBox1" runat="server" /> <asp:TextBox ID="TextBox2" runat="server" /> <asp:TextBox ID="TextBox3" runat="server" /> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Field Required" ValidationGroup="Group1" ControlToValidate="TextBox1,TextBox2,TextBox3" SetFocusOnError="true"></asp:RequiredFieldValidator> I know i can only put 1 value to the ControlToValidate property of "RequiredFieldVal...

using a .Net Control as activex control in VCL form
Hi , We have a to integrate a simple .Dot CSharp control which needs to be integrated into bcb2010 VCL form as a control. We will place the control on the VCL form along with other VCL controls's. I tried creating a simple .net control using a lable+textbox and trying to use in vcl form. I have made the assembly comvisible and generated tlb files and .bpl for the component. I could see the component in "ActiveX" tool palette. But when I drag the object onto VCL form and try to access its attributes I run into problems. I am not able to see .net control on the vcl at runti...

Validation controls are triggereing other forms validation controls?
Can someone please look at this an explain whats going on. When you click on subscribe it triggers my registration form validation controls. I'not sure what "subscribe" is supposed to do, but if you dont want it to cause validation, set the CausesValidation property to false.Mike Banavige~~~~~~~~~~~~Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/ Make sure the feild is an email address Hey coolkidsonly, your initial posting didn't show us anything to look at. We are just guessing here without the specifics. However, m...

Controlling web control instances on Web Form
I have created a composite control, extending functionality of the Hidden Control. However, I would like to prevent the user from adding this control to the page multiple times. I only want one instance of the control on the Web Form. What setting in my project to I adjust to enable this functionality? I can not find it in any of the books that I have referenced. Is this a setting or is this code that has to be added to the inheriting class. Looks like there is no standard apporach. But I'd consider using static field to count number of created objects and throw exception if second object ...

How to validate controls on a .NET 2.0 Web user Control
Hi Guys, (ASP.NET 2.0 / C#) I've looked thorugh every post on validating web user controls (and know about Pter Blum's Professional Validation and More package) - but can't seem to get my head around whre to start. I have a web user control, called wucICL.ascx on a we page called AddEditInvestment.aspx.  I would like to validate a couple of DropDownLists (ddlAccounts and ddlContacts) when the Insert and Update buttons are clicked on the AddEdit Investment page. The other controls on the AddEditInvestments page belong to a validation group called All Validators and the DropDownL...

Validation of a control based on input of another control using requiredfieldvalidators
Hi I have a form that has two checkboxes and 6 textboxes. If the first checkbox is checked then I have to validate the first 3 textboxes. If the 2nd checkbox is checked then the other 3. I want to perform this using required field validators.  Can anyone give me an idea on how I can do this?  Thanks in Advance Regards Harihar Hi, If you want to do this in the normal and easy flow then on the click of the check box you have to post back the page and disable the non required field validators. But I think you should go for some javascript so that you will not be required to ...

how to call controls of web control form in coding of other forms?
hello everyone i have one problem i have created one webcontrol shoppingcart in which there are two labels one of qty and other of amt which are initially enable =falsenow on other page(aspx page) i have one txtbox of qty as txtqty i want tat as soon as user enters qty txtqty and clicks on add cart button it shd be display d value in lblqty of web control shopping cart make sure i m using datalist on aspx page so give me suggestions on tat basis and my coding is in vb. plz give ur suggestions as fast as possible. Neeti what do you mean by webcontrol.... it this user control or normal ...

Use Web Custom control or Web User control?
Friends,  I have a generic aspx page and its functions which is used in many .NET web application. The generic page contains a HTML Div control, server drop down list, server buttons, server textbox and it have different server and client functions to do its tasks for calling aspx pages in web applications. My problem is I do not know whether I should make that generic page as a web user control (but this is tedious because all other application folders must store frontpage aspx and code behind files of the generic page) or as a web custom control (This seems to be good beca...

Using Validation Control When the control to validate is initially hidden
Hi to all, When I used the validation controls (RequiredField Validator)  in initially VISIBLE controls, it works fine. But when the controls i want to validate is initially hidden, it seems that the validation doesn't not work. What do you think is the problem?  By the way, my hidden controls is in a table inside a PopUpPanel which is inside an UpdatePanel. Hope you can help me. Thanks Khrizz   khrizz Hello!! You can use like following: to avoid this condition. protected void button1_Click(object sender, EventArgs e) { &nbs...

How to validate the textbox by using Validator control
Hi, may I know how to use the validator control to validate the multiline textbox which not allow the user to key in more than 90 characters. Which calidator control should be used and how to do the set up for the control. Hi, in the past I used a small javascript that counted the total length of what's inside the <textarea>. You can find, like I did that time, such scripts on the Internet. If you're looking for a solution with a validation control you could take a look at this small code snippet: <%@ Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Tran...

I have a web user control being used by another web user control, but the one being used will not display the labels in the resx file.
I am using DotNetNuke version 3.13 (might be 3.013) on a Window's XP machine, SP2. I have what I find to be an extremely odd situation. I have a project called TDS.Controls. This project is a web control library. Each control has its own resx file, which is located in the App_LocalResources directory. Each control inherits from Framework.UserControlBase, just like DotNetNuke's User control in DNN\Controls\User.ascx.vb. As a matter of fact, this control is doing the exact same thing I am trying to do. It is a web user control with its own resx file being used by another web user control (See ...

Web resources about - Which validation control to use to control input textbox text length ? - asp.net.web-forms

Cross-validation (statistics) - Wikipedia, the free encyclopedia
is a model validation technique for assessing how the results of a statistical analysis will generalize to an independent data set. It is mainly ...

Serena Williams eyes history, Caroline Wozniacki craves validation in women's US Open final
As Serena Williams eyes another slice of tennis history, Caroline Wozniacki is craving validation with a watershed US Open final triumph on Sunday ...

Travers Duncan asks High Court to strike down ICAC validation laws
ICAC could be sent back to the High Court as a challenge to new laws validating corruption findings looms.

Adam Scott proclaims Texas win as validation of No.1 ranking
... No.1 golfer, beating American Jason Dufner in the third hole of a play-off at the Colonial event. "It's a good feeling and maybe some validation ...

Hollande to sign gay marriage bill after Constitutional Council's validation
Hollande to sign gay marriage bill after Constitutional Council's validation People's Daily Online ... 26, 27, 28, 29, 30, 31. Jan, Feb, Mar, ...

Marketers, Get Ready for the 'Validation Era'
The public brands included has been engaging in a "friends" arms race. But there are signs that we know we overdid it.

Validation and Uncertainty
What an extraordinary conversation I had recently on Twitter. It started with Neil Killick’s statement that we should not consider our stories ...

Nvidia Icera 410 LTE Modem Passes AT&T Network Validation
... Today's news is a small step and logical precursor toward both goals, Nvidia's Icera 410 LTE and HSPA+ baseband has passed AT&T's network validation ...

Ting’s Q1 Subscriber Growth Suffers from Sprint’s New Unlocking Validation Process
Back in February, Sprint updated the process it uses to validate unlocked devices that customers want to utilize on other carriers or one of ...

[Android M Feature Spotlight] Stricter APK Validation Now Actually Checks If All Of An APK's Files Are ...
While you might file this one under "really? We weren't doing this already?" if you're a security expert, Google has added stricter validation ...

Resources last updated: 12/3/2015 9:03:02 AM