Dynamic refresh of a UserControl

O

oaksong

I have an embedded user control based on TreeView that I would like to
refresh dynamically.
The control is in a <div > that's hidden until a specific selection
has been made. Unfortunately the control has already been populated by
the time the user makes the selection, with all of it's info buried in
the State.

I've done quite a bit of research at this point and I'm not finding
this specific functionality. I'm not looking to refresh a couple
nodes, I need to replace the entire tree.

I've looked at controls.add, but that fails with the well known
"Controls collection cannot be modified <%...%>" error.

The page has several UC's which have the standard <%@ reference at the
top of the page. I'm guessing that this is what's causing the problem
as there are no <%='s anywhere.

If someone could point me in a good direction I would much appreciate
it. I've already spent a day on this and it seems like something that
would be rather common place.

tia
Chris
 
C

Cowboy \(Gregory A. Beamer\)

If you need the data to update, you will either have to take a trip to the
server (page refresh) or use something like AJAX. If you want this to appear
seemless, AJAX is your better option. Between the AJAX bits in VS 2008 (or
added to VS 2005) and the AJAX Toolkit (downloadable from codeplex), you can
even build in the visibility aspect.
 
O

oaksong

I have an embedded user control based on TreeView that I would like to
refresh dynamically.
The control is in a <div > that's hidden until a specific selection
has been made. Unfortunately the control has already been populated by
the time the user makes the selection, with all of it's info buried in
the State.

I've done quite a bit of research at this point and I'm not finding
this specific functionality. I'm not looking to refresh a couple
nodes, I need to replace the entire tree.

I've looked at controls.add, but that fails with the well known
"Controls collection cannot be modified <%...%>" error.

The page has several UC's which have the standard <%@ reference at the
top of the page. I'm guessing that this is what's causing the problem
as there are no <%='s anywhere.

If someone could point me in a good direction I would much appreciate
it. I've already spent a day on this and it seems like something that
would be rather common place.

tia
Chris

To clarify:

I'm using a dropdownlist to fire a postback, however I've discovered
that the UC refreshes before the click event for the dropdownlist gets
fired.

I need to set some session variables, but I need to know which
dropdownlist control was fired.
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top