Validation of fields in FormView C#

Validation of fields in FormView C#

am 15.04.2008 19:23:01 von c# junkie

Title says it ... my C# web application uses a number of FormViews that are
inserted/updated/deleted via stored procedures.

Is there a way thru C# coding (example?) to validate a date field as valid
input before inserting/updating? Test the length of a varchar/char field?
Validate an int field as valid numeric input (no alpha) ... and so on?

I would like to do this validation before the stored procedures fire
(perhaps stopping), of course so the user does not see the cryptic messages
that come back by default.

It would be nice to see some C# examples or the specifics on another
workarounds. Thanks to all you pros for reading.

Re: Validation of fields in FormView C#

am 15.04.2008 19:36:20 von reb01501

c# junkie wrote:
> Title says it ... my C# web application uses a number of FormViews

There was no way for you to know it (except maybe by browsing through
some of the previous questions before posting yours - always a
recommended practice), but this is a classic asp newsgroup. ASP.Net is
a different technology from classic ASP. While you may be lucky enough
to find a dotnet-savvy person here who can answer your question, you
can eliminate the luck factor by posting your question to a newsgroup
where the dotnet-savvy people hang out. I suggest
microsoft.public.dotnet.framework.aspnet.
There are also forums at www.asp.net where you can find a lot of people
to help you.


> that are inserted/updated/deleted via stored procedures.
>
> Is there a way thru C# coding (example?) to validate a date field as
> valid input before inserting/updating? Test the length of a
> varchar/char field? Validate an int field as valid numeric input (no
> alpha) ... and so on?

Do you mean like the intrinsic Validator controls?
..

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.