ASP.NET pages expect you to create the same list of controls on post back
that you sent to the browser originally. This allows the post back code
distribute the data to those controls and fire their events (including
Click, TextChanged, and validation). It sounds like you aren't setting
things up the same on each pass.
I recommend this:
Load both UserControls. Change their Visibility. On the first pass,
UserControl 2 should be invisible. On the second pass, during the Click even
method, first test that validation was OK (Page.IsValid=true), then change
the visibility of these Usercontrols.
--- Peter Blum
www.PeterBlum.com
Email:
PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
<br********@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I have a ASPX page that loads a custom control. This first custom
control is made up of 2 textboxes and a Submit button. The user enters
data into the form, presses the Submit button and the ASPX page should
either load a new custom control during the postback or (if validation
fails) reload the first custom control. I've attached some validation
controls without a problem but the client-side validation doesn't seem
to be working...even in IE with Javascript enabled.
Does anyone have any suggestions? Thanks!