473,586 Members | 2,792 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically Loaded controls loading other controls

Hi All,

I am loading a web user control (.NET 2.0) into a placeholder on a content
page ( plus the use of a master page).

The controls is a list of companie, one you select a company for editing,
the edit button loads the "editcompany.as cx" control into the placeholder
which was just occupied by the "companylist.as cx" control.

This all works just fine, but I gues you see my problem coming.... as soon
as you click any of the buttons on the "editcompany.as cx" control the page is
reloaded and it goes back to the original list without even touching the
event of the button which triggered the postback.

I know it happens because the control is loaded on the "edit" event from the
original list, which means that the page is updated after the viewstate has
been completed.

I am now wondering if somebody has used this thechnique successfully before,
and I don't want to do redirects to another page with some data in the QS, I
want it to stay within the same page, at least for related functionallity.

Any pointers to articles or tips are greatly appreciated.

Thanks

Wouter
Feb 27 '06 #1
3 1545

Wouter,

I have a few samples that may be helpful to you on my website. Go to
http://www.aboutfortunate.com?page=codelibrary and use the search box there
to search for dynamic control. The top hits you get are all going to give
you little necessary pieces to do what you wish.

If you have any questions after looking at the samples feel free to contact
me.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Wouter" <Wo****@discuss ions.microsoft. com> wrote in message
news:5F******** *************** ***********@mic rosoft.com...
Hi All,

I am loading a web user control (.NET 2.0) into a placeholder on a
content
page ( plus the use of a master page).

The controls is a list of companie, one you select a company for editing,
the edit button loads the "editcompany.as cx" control into the placeholder
which was just occupied by the "companylist.as cx" control.

This all works just fine, but I gues you see my problem coming.... as soon
as you click any of the buttons on the "editcompany.as cx" control the page
is
reloaded and it goes back to the original list without even touching the
event of the button which triggered the postback.

I know it happens because the control is loaded on the "edit" event from
the
original list, which means that the page is updated after the viewstate
has
been completed.

I am now wondering if somebody has used this thechnique successfully
before,
and I don't want to do redirects to another page with some data in the QS,
I
want it to stay within the same page, at least for related functionallity.

Any pointers to articles or tips are greatly appreciated.

Thanks

Wouter

Feb 27 '06 #2
Hi Justin,

Thanks for the link to your site and the articles you have there.

I have to experiment with the some bits and pieces of code you have there to
see if it works for me too.

I'll let you know how it goes,

Thanks again,

Wouter

"S. Justin Gengo [MCP]" wrote:

Wouter,

I have a few samples that may be helpful to you on my website. Go to
http://www.aboutfortunate.com?page=codelibrary and use the search box there
to search for dynamic control. The top hits you get are all going to give
you little necessary pieces to do what you wish.

If you have any questions after looking at the samples feel free to contact
me.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Wouter" <Wo****@discuss ions.microsoft. com> wrote in message
news:5F******** *************** ***********@mic rosoft.com...
Hi All,

I am loading a web user control (.NET 2.0) into a placeholder on a
content
page ( plus the use of a master page).

The controls is a list of companie, one you select a company for editing,
the edit button loads the "editcompany.as cx" control into the placeholder
which was just occupied by the "companylist.as cx" control.

This all works just fine, but I gues you see my problem coming.... as soon
as you click any of the buttons on the "editcompany.as cx" control the page
is
reloaded and it goes back to the original list without even touching the
event of the button which triggered the postback.

I know it happens because the control is loaded on the "edit" event from
the
original list, which means that the page is updated after the viewstate
has
been completed.

I am now wondering if somebody has used this thechnique successfully
before,
and I don't want to do redirects to another page with some data in the QS,
I
want it to stay within the same page, at least for related functionallity.

Any pointers to articles or tips are greatly appreciated.

Thanks

Wouter


Feb 27 '06 #3
Hi Justin,

Thanks again, in the end I used your article "Dynamicall y added user
control's button click event doesn't fire until second time clicked?" and
place the ID = "ControlID" ; in the page_onload event of the control..

That seemed to have solved the problem.

Thanks,

Wouter

"S. Justin Gengo [MCP]" wrote:

Wouter,

I have a few samples that may be helpful to you on my website. Go to
http://www.aboutfortunate.com?page=codelibrary and use the search box there
to search for dynamic control. The top hits you get are all going to give
you little necessary pieces to do what you wish.

If you have any questions after looking at the samples feel free to contact
me.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Wouter" <Wo****@discuss ions.microsoft. com> wrote in message
news:5F******** *************** ***********@mic rosoft.com...
Hi All,

I am loading a web user control (.NET 2.0) into a placeholder on a
content
page ( plus the use of a master page).

The controls is a list of companie, one you select a company for editing,
the edit button loads the "editcompany.as cx" control into the placeholder
which was just occupied by the "companylist.as cx" control.

This all works just fine, but I gues you see my problem coming.... as soon
as you click any of the buttons on the "editcompany.as cx" control the page
is
reloaded and it goes back to the original list without even touching the
event of the button which triggered the postback.

I know it happens because the control is loaded on the "edit" event from
the
original list, which means that the page is updated after the viewstate
has
been completed.

I am now wondering if somebody has used this thechnique successfully
before,
and I don't want to do redirects to another page with some data in the QS,
I
want it to stay within the same page, at least for related functionallity.

Any pointers to articles or tips are greatly appreciated.

Thanks

Wouter


Feb 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3251
by: Tim T | last post by:
Hi, I have the need to use dynamically loaded user controls in a webform page. I have the controls loading dynamically, and that part works fine. this is the code used in a webform to dynamically load one of several controls: private void btnCategory_Click(object sender, System.EventArgs e) { Control myControl =...
1
8152
by: Earl Teigrob | last post by:
PROBLEM: When a user control is loaded into a PlaceHolder control more than once, the events do not fire on the first click of a control on the dynamically loaded user control. In other words, the first time the control is dynamically loaded, everything works fine. After that, if the control is loaded again from the page button event handler,...
1
1652
by: Greg | last post by:
In my ASP.NET application I have a button that when pressed, data needs to be saved based on what the user typed in. I have other controls on the same page that should be updated as a result of the save, which are all dynamically created in the code behind and have event handlers registered. In the page life cycle, event handlers are called...
1
13663
by: Josh | last post by:
Hi Guys, I have been having a big problem with trying to pass parameters into a user control when the user control is dynamically loaded into a placholder. I am developing in c#. I have get and set methods on the user control "editButton.ascx" which work fine. How do i pass parameter into the user controls "c1", "c2" ? Here is a bit...
4
3105
by: Harry | last post by:
Hello, I have a page with a RadioButtonList and a PlaceHolder control. The RadioButtonList's AutoPostBack attribute is set to TRUE and its SelectedIndexChanged event loads one of three UserControls into the PlaceHolder's child control collection depending upon which of the three radio buttons is selected. Each of the three UserControls have...
6
3359
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all the usual stuff of recreating the usercontrol in the Page Init event. The 'failure' sequence is as follows: - select web form button to display...
5
2334
by: Alan Silver | last post by:
Hello, I have a products page that takes a product ID in the query string. Based on the product details (from a database), the page then loads up one of a number of custom controls, calls a method in the control (that displays product info) and then loads the control into a placeholder so it will be displayed. I want to be able to...
3
1184
by: supvine | last post by:
Hello, I am developing a page that has several custom web user controls that need to be loaded dynamically. Some of the controls are loaded based on the action (button-click) of a different control in the parent page. Currently what I have to do to make this work is set a session variable to load/unload a particular control and do a...
2
1788
by: A.Wussow | last post by:
Hi Everybody, i want to load dynamically content from some user controls (with forms, or some data-controls) using atlas. So i use an UpdatePanel for loading the user control into a placeholder. Using buttons for loading new content works fine. But i still want to use a function which is callable per javascript. I think this way is more...
5
3070
by: Andrew Robinson | last post by:
I have a page that can load a number of different user controls. Each of these user controls inherits from a common base class and the controls are loaded based on application state, status, etc and the specific type of control frequently changes. I have a common event in the base class that each child user control inherits from and that the...
0
7908
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7836
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7950
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6606
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5389
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3835
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3863
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1175
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.