tags:

views:

265

answers:

2

I can't really say I fully understand hopw they interact. Especially when I say if(Page.IsPostBack) in an ASCX Load event, what does it mean. The parent ASPX is postback?

thanks in advance

A: 

This might help you understand the process:

Put a breakpoint on Page_Load on the .aspx page, and another breakpoint on the load event in the user control. Run the app and view the sequence of events.

It might also be helpful to create Init events in both places, just so you can step through them and see the differences.

If your current code is a bit complex, you might want to create a separate sample project just for this purpose. Make a "Hello world" .ascx and put it on a "Welcome" .aspx, set all the breakpoints and step through the code.

Personally, I think this approach is easier to understand and remember than just reading about it.

DOK
you're right. Thanks to both of you...
HowHow
+1  A: 

You are correct. The bool property Page.IsPostBack will tell you if the aspx page containing the ascx control has been submitted to itself. The Page object refers to the aspx page.

dl