Page.IsValid returns false in User controls

Page.IsValid returns false in User controls

Post by Vas » Sat, 10 Nov 2001 14:59:01



Hi,

I have a user control(UC1) with an asp:Textbox and
asp:RequiredFieldValidator controls.  I also have another user
control(UC2) with an asp:Button control.  The Button user control
raises a bubble event to be captured in the parent page.

Now I created another user control(UC3) with the above two user

The bubble event mechanism works fine.

Issue 1) Debug mode:
When I click on the Button(UC2), the Page.IsValid property returns
True until the end of the Page_Load event of UC2.  The next event that
I have the debug symbol at is my custom event that I use to raise the
bubble event.  When the control comes to this point the Page.IsValid
returns False.  Why is it happening and what am I missing here?

Issue 2) Debug mode:
I noticed that each event triggers twice.  Because of this behavior, I
have to use flags to avoid multiple executions of the code.  Am I not
doing the right way or is there any other solution for this?

I appreciate your help.

Vasu

 
 
 

Page.IsValid returns false in User controls

Post by Bertrand Le Ro » Sat, 10 Nov 2001 18:24:26


Try testing it in OnPreRender
When you're testing it, all controls on the page may not have been created
yet, and that's why you have to test later.


> Hi,

> I have a user control(UC1) with an asp:Textbox and
> asp:RequiredFieldValidator controls.  I also have another user
> control(UC2) with an asp:Button control.  The Button user control
> raises a bubble event to be captured in the parent page.

> Now I created another user control(UC3) with the above two user

> The bubble event mechanism works fine.

> Issue 1) Debug mode:
> When I click on the Button(UC2), the Page.IsValid property returns
> True until the end of the Page_Load event of UC2.  The next event that
> I have the debug symbol at is my custom event that I use to raise the
> bubble event.  When the control comes to this point the Page.IsValid
> returns False.  Why is it happening and what am I missing here?

> Issue 2) Debug mode:
> I noticed that each event triggers twice.  Because of this behavior, I
> have to use flags to avoid multiple executions of the code.  Am I not
> doing the right way or is there any other solution for this?

> I appreciate your help.

> Vasu


 
 
 

Page.IsValid returns false in User controls

Post by Vas » Mon, 12 Nov 2001 06:14:49


Roy,

Thanks for the reply.  The actual problem is linked with the
Validation controls that I have on the page. I fixed the problem by
making some changes to my program.

Vasu


> Try testing it in OnPreRender
> When you're testing it, all controls on the page may not have been created
> yet, and that's why you have to test later.



> > Hi,

> > I have a user control(UC1) with an asp:Textbox and
> > asp:RequiredFieldValidator controls.  I also have another user
> > control(UC2) with an asp:Button control.  The Button user control
> > raises a bubble event to be captured in the parent page.

 
 
 

1. CustomValidator.IsValid value not pushed up to Page.IsValid

My custom validator checks a value and sets its IsValid property
accordingly.  In the case when it is set to false, how does that get rolled
into the Page.IsValid property, which is read only?  After the
ServerValidate action happens, the buttons OnClick event happens and
continues on its merry way because Page.IsValid = true even though the
custom validator's IsValid property = false

2. Internet Mail and Outlook Express ?

3. Why does User.IsInRole returns false in asp.net

4. what is minix's usage

5. Page.IsValid performs a postback for a toolbarbutton web control

6. Unknown error to me

7. Determening if Page.IsValid from client side script

8. DX6 z-buffer surface

9. Validation and Page.IsValid

10. Determening if Page.IsValid from client side script

11. "Page.IsValid" doesn't work IT'S URGENT!!!

12. Page.IsValid