Dynamically Loaded controls loading other controls

G

Guest

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.ascx" control into the placeholder
which was just occupied by the "companylist.ascx" 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.ascx" 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
 
S

S. Justin Gengo [MCP]

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
 
G

Guest

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
 
G

Guest

Hi Justin,

Thanks again, in the end I used your article "Dynamically 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top