468,771 Members | 1,763 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,771 developers. It's quick & easy.

IsPostBack Sequencing problem in dynamically created controls on web page.

Hi Friends !!

I am have facing problem in controlling the dynamically created
controls on web page. The problem Scenario is

Scenario:- My requirement is to load the web user controls on the web
page dynamically. To do this, First I including a web page
(MainPage.aspx) and I made form tag to Runat=Server. I included one
table tag and also made this table Runat=Server side. Second I created
three Web User Controls e.g. wucCustomerInfo.ascx,
wucOrderSpecifications.ascx and wucOrderDetails.ascx.

Now on the page_load of MainPage.aspx.vb, I am creating the table rows
dynamically and loading the controls in the following sequence (i)
wucCustomerInfo.ascx (ii) wucOrderSpecifications.ascx (iii)
wucOrderDetails.ascx. NOTE: I removed the <Form> tag from each web
user control.

For you reference, this code is working fine as it is loading the
controls in the same sequence and showing the contents of each
controls with the required data. Now problem comes,

Problem:-

(1) My first problem is that, whenever I click any button of either
MainPage.aspx or any web user control then it is executing PostBack of
MainPage.aspx and web user controls in the same sequence as it is
loading. What I want is if I click on any button of say
"wucOrderSpecifications.ascx" control then it should Execute the
PostBack of this control and should execute NotPostBack of all the
controls. Is there any way to do this?

(2) If I dynamically load the controls in MainPage.aspx under
NotPostBack... e.g.

'-- MainPage.aspx
If Not(IsPostBack) Then
' Load Controls Dynamically
End If

and If I click on any of the button on any web user control then the
next time controls are not coming.
Nov 18 '05 #1
1 2737
Hi Kamal:

It sounds as if you want to know which user control the user clicked
in. You can handle a specific event, like a button click event, inside
the user control logic.

For a good example see: Handling User Control Events
http://msdn.microsoft.com/library/de...eletevents.asp

Note: The load function in the parent web form will always fire and
will have IsPostBack set to true. I'm not sure why you had to remove
FORM elements from the user controls, they should not have any.

--
Scott
http://www.OdeToCode.com

On 23 Sep 2004 08:21:37 -0700, kj****@gmail.com (Kamal Jeet Singh)
wrote:
Hi Friends !!

I am have facing problem in controlling the dynamically created
controls on web page. The problem Scenario is

Scenario:- My requirement is to load the web user controls on the web
page dynamically. To do this, First I including a web page
(MainPage.aspx) and I made form tag to Runat=Server. I included one
table tag and also made this table Runat=Server side. Second I created
three Web User Controls e.g. wucCustomerInfo.ascx,
wucOrderSpecifications.ascx and wucOrderDetails.ascx.

Now on the page_load of MainPage.aspx.vb, I am creating the table rows
dynamically and loading the controls in the following sequence (i)
wucCustomerInfo.ascx (ii) wucOrderSpecifications.ascx (iii)
wucOrderDetails.ascx. NOTE: I removed the <Form> tag from each web
user control.

For you reference, this code is working fine as it is loading the
controls in the same sequence and showing the contents of each
controls with the required data. Now problem comes,

Problem:-

(1) My first problem is that, whenever I click any button of either
MainPage.aspx or any web user control then it is executing PostBack of
MainPage.aspx and web user controls in the same sequence as it is
loading. What I want is if I click on any button of say
"wucOrderSpecifications.ascx" control then it should Execute the
PostBack of this control and should execute NotPostBack of all the
controls. Is there any way to do this?

(2) If I dynamically load the controls in MainPage.aspx under
NotPostBack... e.g.

'-- MainPage.aspx
If Not(IsPostBack) Then
' Load Controls Dynamically
End If

and If I click on any of the button on any web user control then the
next time controls are not coming.


Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by patrick_a | last post: by
1 post views Thread by Karl Seguin | last post: by
4 posts views Thread by sebastien | last post: by
9 posts views Thread by Chris | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.