WebControl validator not working on response.redirect

L

Lenine Jeganathan

I have stumbled into a strange problem with asp.net
requiredfieldvalidator. Here is the code. This is part of a webform
aspx which gets invoked in two ways.

scenario 1) One from a datagrid hyperlink
scenario 2) By way of response.redrect.

The validator works fine when coming into the page from the datagrid
URL ( scenario 1) and not when I come in by way of response.redirect.
In the second case it does validate when I post (causing validation)
but not when I tab through. The tab through works fine in the senario
1.

Thanks for any help,
Lenine

PS: .Net FrameWork 1.1
OS: Windows Server 2003
Browser: IE 6

<tr>
<TD style="WIDTH: 156px; HEIGHT: 20px" align="left"><asp:label
id="Label20" runat="server" Width="52px"
Height="16px">Tel:</asp:label></TD>
<TD style="WIDTH: 186px; HEIGHT: 20px" align="left"><asp:textbox
id="txtPhone" runat="server" Width="116px" Height="20px">
</asp:textbox>
<asp:requiredfieldvalidator id="valReqd3"
runat="server"
ErrorMessage="* Please enter a valid Phone number"
ControlToValidate="txtPhone" Display="dynamic">
</asp:requiredfieldvalidator>
</TD>
</tr>
 
A

Ashish Kaila

Check to see if response.redirect is filling in the proper value in
querystring. I suspect you may need to manually refill using
Request.QueryString in the latter case. If so use Customvalidator and mimic
the functionality of RequiredFields vallidator.
HTH
Ashish
 
L

Lenine Jeganathan

Yeah, I had to settle with a Customvalidator. Thanks for your help
Lenine
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top