standard input controls

P

Peter Kirk

Hi

are there "user controls" available for input fields - for example an
integer field, a date field, a string field - which provide properties like
a label, max length, and validation functions etc for the data?

Thanks,
Peter
 
R

recoil

Hello Peter.
These are seperated into 2 controls.
You use the TextBox for the input and attach a ValidationControl.
Hopefully you are using Visual Studio 2005/.NET 2.0 as the Validator
controls are supposed to be "better" improved. I don't personally use them
because of Microsoft's refusal to create js code that works on all browsers
and to make them flexible however below is a sample.

<asp:TextBox runat="server" ID="txtDummy"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1"
runat="server" ControlToValidate="txtDummy"
ErrorMessage="RegularExpressionValidator"
ValidationExpression="^.[\d]*$"></asp:RegularExpressionValidator>


You can find this validator under the "Validation" section of the toolbox
when you are in design mode.
 
R

recoil

Hello Peter.
These are seperated into 2 controls.
You use the TextBox for the input and attach a ValidationControl.
Hopefully you are using Visual Studio 2005/.NET 2.0 as the Validator
controls are supposed to be "better" improved. I don't personally use them
because of Microsoft's refusal to create js code that works on all browsers
and to make them flexible however below is a sample.

<asp:TextBox runat="server" ID="txtDummy"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1"
runat="server" ControlToValidate="txtDummy"
ErrorMessage="RegularExpressionValidator"
ValidationExpression="^.[\d]*$"></asp:RegularExpressionValidator>


You can find this validator under the "Validation" section of the toolbox
when you are in design mode.

Your mileage may vary / use at your own risk / hope this helps :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,125
Messages
2,570,748
Members
47,301
Latest member
SusannaCgx

Latest Threads

Top