473,395 Members | 1,411 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,395 software developers and data experts.

Multiple user controls not reloading properly

Hi everyone,

I have two user controls on a webform that display overlapping
information but each in quite different ways. One of the controls can
update information in the database and the other one displays some of
that information.

The first control saves back to the database and the displays the new
information (obviously!) But the second control does not and after the
update is still displaying the old info.

How do I make the whole schebang refresh? I know I could probably just
redirect the user back to the same url but this seems unnecessary given
the amount of control you can exercise in dotnet. Is there a simpler
way?

Regards,
Mark

Nov 19 '05 #1
4 1112
make sure you databind both controls after the postback to update the
database,

I suspect that the second control is using viewstate to render its data

Nov 19 '05 #2
Thanks for the quick reply ;)

However, how does the second control know when to databind? At the
moment the second control does its initial databind its page_load
event. But I have defined no other events in the control.

I think I need a way of specifying that the second control should be in
some way "dependant" on the first. I've thought about firing an event
in the first control and then registering the second to catch it but
does that not seems cumbersome?

Thanks again

Nov 19 '05 #3
are you checking for Page.isPostBack ?

you might not be rebinding the second data grid after doing the update,

Zip up the code and mail it to me and I'll take a look

Nov 19 '05 #4
Hi and thanks for the help.

I've found a new event that seems to be doing the trick. Its the
OnDataBinding event.

If I call don't worry about loading any data in the PageLoad event and
just make the call to DataBind and if I load the data in this data
binding event instead then it doesn't matter where I call DataBind
from, the data will always be loaded.

Anyway, it probably seems a bit confusing as to what I'm doing, but
your reply was useful because it put me on a slightly different path.
Thanks muchly,

Mark

Nov 19 '05 #5

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

Similar topics

10
by: Alphonse Giambrone | last post by:
I have a web form with 2 user controls on it (UC1 and UC2). Each control has a bound datagrid with textboxes in the footer to add a new row. There are also requiredfieldvalidators in each footer....
4
by: John | last post by:
Hi all, I have posted this type of question quite a few times but to date, no-one has actually been able to provide me with a solution. I really need to understand how to do this properly. My...
6
by: Jim | last post by:
I have a user control that I am dynamically loading into an aspx page. When I fill out the text boxes and submit the form using a command button on the aspx page I lose the value from the user...
1
by: Andre Ranieri | last post by:
I have a quick question - I'd just like to have confirmation to be sure. I'm building an ASP.NET corporate site for my employer, some of the pages have e-commerce capability and will need to be...
3
by: Nathan Sokalski | last post by:
When I view any page in my application a second time, I recieve the following error: System.Web.TraceContext.AddNewControl(String id, String parentId, String type, Int32 viewStateSize) +313...
2
by: TB | last post by:
Hi All: A very simple question, which I hope has a simple answer: On page.aspx I have two user controls: part1.ascx and part2.ascx How can I trigger the reloading of part2.ascx from within...
9
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will...
2
by: ChrisCicc | last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have...
5
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hallo, I have a radiobuttonlist control that is added on a custom Web User Control. This control has a property that exposes the SelectedIndex property of the embedded radiobuttonlist. When...
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...
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
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.