[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

=?Utf-8?B?cm9kY2hhcg==?=

2/27/2004 10:41:00 AM

Hi,

I have a web custom control that has a TextBox and a button..

I add a required field validator to validate this textbox and a validator summary to show if the error exists..

in the event on the button (onclick) im doing a Response.write of the content of this textbox...

When i dont fill the textbox and i click the button, the validator summary shows me the error, but i dont know why the response.write its too executed..

What could be my error im little lost
Thanks in advance
Josema.
1 Answer

Peter Blum

3/1/2004 10:14:00 PM

0

While ASP.NET automatically runs the Page.Validate() method for you, you are
responsible for testing its result in Page.IsValid and only then running the
code in your click event.

<click event method>
If Page.Validate() Then
' do your click code.

--- Peter Blum
www.PeterBlum.com
Email: PLBlum@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam...

"Josema" <anonymous@discussions.microsoft.com> wrote in message
news:7D03E95C-8A16-4500-96AA-5BA91288E680@microsoft.com...
> Hi,
>
> I have a web custom control that has a TextBox and a button...
>
> I add a required field validator to validate this textbox and a validator
summary to show if the error exists...
>
> in the event on the button (onclick) im doing a Response.write of the
content of this textbox...
>
>
> When i dont fill the textbox and i click the button, the validator summary
shows me the error, but i dont know why the response.write its too
executed...
>
> What could be my error im little lost.
> Thanks in advance.
> Josema.