Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8264175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:21:42+00:00 2026-06-08T04:21:42+00:00

I have a few fields in a webforms and currently I’m not implementing any

  • 0

I have a few fields in a webforms and currently I’m not implementing any form of validation but I intend to do so.

Suppose I have the following UpdateParameters in my SQLDataSource:

<UpdateParameters>
            <asp:Parameter Name="Name" Type="String" />
            <asp:Parameter Name="Date" Type="DateTime" />
            <asp:Parameter Name="active" Type="Boolean" />
            <asp:Parameter Name="ID" Type="Int32" />
</UpdateParameters>

And a textbox for each of the fields. I tried, but couldn’t find a built-in way to validate the TextBoxes against the parameter type, so for example, the Date_TextBox would validate that the input is in a DateTime format. I know I can do custom validators with regexes and whatnot, but I feel there’s a built-in, simple way of doing it. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T04:21:44+00:00Added an answer on June 8, 2026 at 4:21 am

    Have you tried using the CompareValidator??

    You can specify the type like this:

    <asp:TextBox runat="server" ID="txt" />
    <asp:CompareValidator runat="server" ErrorMessage="The type is not a valid integer" 
        ControlToValidate="txt"
        Operator="DataTypeCheck"
        Type="Integer"
        />
    <asp:Button Text="Test valdiation" runat="server" />
    

    The available types are:

    • String. Specifies a string data type.
    • Integer. Specifies a 32-bit signed integer data type.
    • Double. Specifies a double-precision floating-point number data type.
    • Date. Specifies a date data type.
    • Currency. Specifies a monetary data type.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say i have a few fields like the following: abd738927 jaksm234234 hfk342 ndma0834 jon99322
I have a basic PHP form (a few fields and 2 checkboxes, I want
I have a simple html form with few fields in it. I wanted to
I have an online form that has a few fields with time data. I
So I have a Windows form with a few fields to accept data and
I have a long signup form and would like to hide a few fields
I have a few input fields in a form which are submitted using Save
How to validate when certain fields not filling? I have few input with class=string
I have few form fields, each input and label is wrapped inside a div
I have a registration form with a few fields. One of them looks like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.