Re: RequiredValidator not working

Tech-Archive recommends: Speed Up your PC by fixing your registry



"tshad" <tscheiderich@xxxxxxxxxxxxxxx> wrote in message
news:OS0JNvYXFHA.3620@xxxxxxxxxxxxxxxxxxxxxxx
> "TJS" <nospam@xxxxxxxx> wrote in message
> news:uNujJNYXFHA.160@xxxxxxxxxxxxxxxxxxxxxxx
>> You're right, the function should not be called if the page is not valid
>>
>> since it fails in both browsers, and you aren't prefilling the form, I
>> would need to see your code for "ModifyRecord_Click" to determine of the
>> problem is there.
>>
>
> Actually, what I did to make it work is:
>
> Sub ModifyRecord_Click(sendor as Object, e as ImageClickEventArgs)
>
> if not Page.isValid then
> exit Sub
> End If
>
> I guessed the function does get called, so I just added that code to solve
> the problem.
>

Now the problem is in my other routine, which is called by my LinkButton
(the Modify routine was called by an ImageButton).

The code is the same:

Sub DeleteProfile_Click(sender as Object, e as EventArgs)
trace.warn("inside SelectProfile")

if not Page.isValid then
exit Sub
End If

But when I do it I get the error:

Page.IsValid cannot be called before validation has taken place. It should
be queried in the event handler for a control with CausesValidation=True or
after a call to Page.Validate.

So in the Modify function, the validate function is being called and in the
Delete function it is not ???????

Tom
> Tom
>


.


Quantcast