469,613 Members | 1,189 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,613 developers. It's quick & easy.

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 1742
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Daniel | last post: by
10 posts views Thread by sqlboy2000 | last post: by
11 posts views Thread by John J. Hughes II | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.