Dynamic refresh of a UserControl

  • Thread starter Thread starter oaksong
  • Start date Start date
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
 
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.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
 
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.
 
Back
Top