Groups | Blog | Home
all groups > asp.net webcontrols > october 2004 >

asp.net webcontrols : WebControl validator not working on response.redirect


leninej NO[at]SPAM gmail.com
10/21/2004 5:38:15 PM
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>
Ashish Kaila
10/24/2004 11:04:37 PM
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

[quoted text, click to view]

leninej NO[at]SPAM gmail.com
10/26/2004 3:53:05 PM
Yeah, I had to settle with a Customvalidator. Thanks for your help
Lenine

[quoted text, click to view]
AddThis Social Bookmark Button