Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > RequiredFieldvalidator displays error too early

Reply
Thread Tools

RequiredFieldvalidator displays error too early

 
 
Preben Zacho
Guest
Posts: n/a
 
      10-23-2007
Hi there

I have a RequiredFieldValidator that displays the text "Required field" for
a textbox. The problem is, that the text "Required field" is displayed
BEFORE the user presses the button to accept the form. Why does this occure?
Must be some setting I've missed, cause in other forms it works as it
should, where the text is not displayed until the user click the accept
button.

My textbox and validator looks like this:

<asp:TextBox ID="tbFirstName" runat="server"
Width="204px"></asp:TextBox>
<asp:RequiredFieldValidator ID="reqFirstNameUser"
runat="server" ControlToValidate="tbFirstName"
Enabled="True" ErrorMessage="Required field"
Display="Dynamic">
</asp:RequiredFieldValidator>

 
Reply With Quote
 
 
 
 
Mansi Shah
Guest
Posts: n/a
 
      10-24-2007

HI Preben,

You can chceck it by setting "AutoPostBack" property of textbox to
"true", if it can help your coding logic..


Regards,
Mansi Shah.

*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
N
Guest
Posts: n/a
 
      10-24-2007
I will rather check if there is already a control on the page that is
causing auto post back.

"Mansi Shah" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> HI Preben,
>
> You can chceck it by setting "AutoPostBack" property of textbox to
> "true", if it can help your coding logic..
>
>
> Regards,
> Mansi Shah.
>
> *** Sent via Developersdex http://www.developersdex.com ***



 
Reply With Quote
 
Preben Zacho
Guest
Posts: n/a
 
      10-25-2007
Well, I have another control in the form where AutoPostBack="True" (a text
box for searching).

Exactly when is this type of validation executed? And how do I then override
it, so the text is not written before the accept button is triggered?


"N" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I will rather check if there is already a control on the page that is
>causing auto post back.
>
> "Mansi Shah" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>
>> HI Preben,
>>
>> You can chceck it by setting "AutoPostBack" property of textbox to
>> "true", if it can help your coding logic..
>>
>>
>> Regards,
>> Mansi Shah.
>>
>> *** Sent via Developersdex http://www.developersdex.com ***

>
>


 
Reply With Quote
 
john123
Guest
Posts: n/a
 
      10-30-2007
Why not set the ValidationGroup property of the textbox so the validation occurs only when the according button is pressed?


>Well, I have another control in the form where AutoPostBack="True" (a text
>box for searching).
>
>Exactly when is this type of validation executed? And how do I then override
>it, so the text is not written before the accept button is triggered?
>
>
>"N" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>>I will rather check if there is already a control on the page that is
>>causing auto post back.
>>
>> "Mansi Shah" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>
>>> HI Preben,
>>>
>>> You can chceck it by setting "AutoPostBack" property of textbox to
>>> "true", if it can help your coding logic..
>>>
>>>
>>> Regards,
>>> Mansi Shah.
>>>
>>> *** Sent via Developersdex http://www.developersdex.com ***

>>
>>

>
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Is it too early - or is it too late. Knut Arvid Keilen Computer Support 1 02-25-2008 09:41 AM
Firefox displays too high table D_W HTML 15 07-28-2007 01:23 AM
Classic asp date displays- changing over to aspnet date object displays Chumley Walrus ASP .Net 1 12-16-2004 09:57 PM
Sesson_End called too early Kostia ASP .Net 7 10-21-2004 09:53 PM
show requiredfieldvalidator text when page first displays? Bryan Ax ASP .Net Web Controls 2 05-12-2004 03:11 PM



Advertisments