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

User Control Not Updating

Jon
Hi,
using vb.net/vs 2003/sql server 2000

Working on a shopping cart app. I've got a user control that appears on
every page to give a summary of the users shopping cart, eg You have 12
items in your cart, the total is £123.45, this is populated with a stored
procedure that just returns itemcount and itemtotal as output params. This
works fine. On the shopping cart page itself I use a datagrid to list out
the users cart contents and allow him to update quantity or delete an item
from the cart(set quantity to 0). However when a user updates the cart the
user control does not update to reflect the new quantities until either
going to another page or reloading the cart page. It seems that what I need
is something like
if cart has been updated then
refresh the user control

Any suggestions? I'm very new to asp.net - obviously :-)

Cheers,
Jon
Nov 18 '05 #1
1 1854
Hi, Jon,

If you have a reference to the usercontrol and you can access this reference
in the method that updates the cart then use this reference to call some
method that will update the usercontrol.

Something like (the class of the page that updates the cart):

//the reference:
protected CartDisplayUserControl control1;

//the event handler for the "Update" button
protected void HandleUpdateClick(object s, EventArgs e)
{
// process here...

// force the control to refresh:
control1.SomeMethodThatRefreshesIt();
}

Greetings
Martin
"Jon" <jo*******@NOCRAPTHANKStiscali.co.uk> wrote in message
news:uX**************@TK2MSFTNGP10.phx.gbl...
Hi,
using vb.net/vs 2003/sql server 2000

Working on a shopping cart app. I've got a user control that appears on
every page to give a summary of the users shopping cart, eg You have 12
items in your cart, the total is £123.45, this is populated with a stored
procedure that just returns itemcount and itemtotal as output params. This
works fine. On the shopping cart page itself I use a datagrid to list out
the users cart contents and allow him to update quantity or delete an item
from the cart(set quantity to 0). However when a user updates the cart the
user control does not update to reflect the new quantities until either
going to another page or reloading the cart page. It seems that what I need is something like
if cart has been updated then
refresh the user control

Any suggestions? I'm very new to asp.net - obviously :-)

Cheers,
Jon

Nov 18 '05 #2

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

Similar topics

10
by: Charles Law | last post by:
I have a user control created on the main thread. Let's say, for arguments sake, that it has a single property that maintains a private variable. If I want to set that property from a worker...
2
by: Tolga | last post by:
How do insert a user control i have created into a datagrid cell. Basically i am trying to create a column of my user controls. This is what i have tried so far. int i = 0; while (i <...
1
by: Earl Teigrob | last post by:
Background: When I create a ASP.NET control (User or custom), it often requires security to be set for certain functionality with the control. For example, a news release user control that is...
2
by: Daniel | last post by:
Hi, i have problem with user control: I have created a DIV to dynamically load User control in it. After loading the user control into the DIV, i click on the button to change label's text....
10
by: sqlboy2000 | last post by:
Hello all, I have something very simple going on here and I'm scratching my head as to what the problem is. There are 4 items in my project, 2 webforms, a user control, and a module: ...
3
by: | last post by:
Hello, I have created an ASP.NET 2.0 application that utilized a Gridview Control to display and update/delete data. The problem I am having is that the gridview control is displaying the data...
2
by: Colli | last post by:
Hi: I need to setup a continuously updating system Date/Time in my user interface. I can get the system date/time and can cause it to update with a button-click but I can't seem to figure out how...
11
by: John J. Hughes II | last post by:
I have a DataGridView displaying data from a DataSet. To the right of that I have a custom user control which displays one of the data set fields. The custom user control is bound to the data set...
1
by: Dave A | last post by:
I have a problem that I have boiled down to a very simple example. I have a user control that displays a some data from a business object. On one screen I have a collection of these business...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.