473,382 Members | 1,809 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Dynamic refresh of a UserControl

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
Mar 28 '08 #1
2 1696
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!
|
*************************************************
"oaksong" <oa*****@hotmail.comwrote in message
news:df**********************************@k13g2000 hse.googlegroups.com...
>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

Mar 28 '08 #2
On Mar 28, 10:50 am, oaksong <oaks...@hotmail.comwrote:
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.
Mar 28 '08 #3

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

Similar topics

0
by: lc | last post by:
I use a series of UserControl that get dynamically created and (all) docked (fill) on one form panel. Problem is that I have to call UserControl.BringToFront() more than once to get it to show....
4
by: Rob Koch | last post by:
What's the best way to refresh a usercontrol using a parameter? My usercontrol is just a DataList that retrieves data from SQL in association with a public propterty. I click on a LinkButton in...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
2
by: John Ninan | last post by:
I am creating Dynamic Usercontrol in Asp.net application. In this application I have a combobox(aspx Page). Which contains various items. Based on item selected I am dynamically populating...
9
by: TCORDON | last post by:
I have a user control that contains 2 image buttons, when you click one of them, both must change the image source, the thing is that the first time you click any one of them the page appears to do...
4
by: Fueled | last post by:
Hi everyone! I've made quite a lot of research on this, and I've tried a couple of proposed solutions. Nothing has worked for me, but I feel there's not much I'm missing. So I'm turning to this...
17
by: SamSpade | last post by:
picDocument is a picturebox When I do picDocument.Invalidate() the box paints. But if instead I do picDocument.Refresh() the box does not paint. What does Refresh do. I guessed it did an...
0
by: Erakis | last post by:
Hi, I need to put a very large image as background (1030px X 774px) on the main window of my application. Also, on this window I need to add transparent Usercontrol, Panel and Label. Every...
14
by: asdf | last post by:
I have a python script whose output i want to dynamically display on a webpage which will be hosted using Apache. How do I do that? thanks
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.