PC Review


Reply
Thread Tools Rate Thread

Validation Server Controls used with multiple HtmlInputButton Controls

 
 
nzanella@cs.mun.ca
Guest
Posts: n/a
 
      30th Jan 2005

Hello,

I have an ASP.NET HTML form control with multiple
HTML input button controls each of which has an
associated HTML input control. For each HTML
input control I have a validator that checks
that the input value is greater than zero.
But I want zero to be displayed within the
text field and want the validator to run
only when the corresponding button is
pressed.

Basically my form looks like this:

Quantity A: [ 0 ]
[Submit Button A]

Quantity B: [ 0 ]
[Submit Button B]

Quantity C: [ 0 ]
[Submit Button C]

Quantity D: [ 0 ]
[Submit Button D]

Each quantity is OK when set to zero, but whenever
Submit Button X is pressed I want my ASP Validator
control to check that Quantity X is greater than
zero.

My problem right now is that asp:RangeValidator
does not seem to provide a way to specify that
the validator is run only when a very particular
button within the form is pressed (as opposed to
whenever any button within the form is pressed).

Could anyone please suggest a solution to this
problem (besides processing POST variables
directly within code and hard coding the
validation in a separate function). Is
there a better way? What is the best
way to tackle this particular problem
in ASP.NET. Yes, I could leave the
input text blank, but that would
violate one of the requirements
of the problem: I want control X
to allow the value zero in the
text box unless the user submits.
Thank you for your replies,

Best Regards,

Neil

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using the HtmlInputButton =?Utf-8?B?U0FM?= Microsoft ASP .NET 2 1st Nov 2006 06:29 PM
how to trigger event with HtmlInputButton? Britt Microsoft VB .NET 2 30th Oct 2006 12:05 AM
Remove language attribute from HtmlInputButton Jonas Microsoft ASP .NET 0 21st Oct 2004 10:14 AM
Message box breaks owner draw controls in .NET controls used as ActiveX controls (again) Clive Dixon Microsoft Dot NET Framework Forms 0 26th May 2004 10:15 AM
ASP.NET Web Forms Validation Controls are Server-Side or Client-Side Validation? Matt Microsoft ASP .NET 14 30th Jan 2004 10:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:54 PM.