This is how I've done it, wouldn't mind other people's input so I'm sure I'm
missing a simple trick somewhere, it shouldn't be this complicated.
Create a class in your App_Code directory called IMyInterface and have this
in it
public interface IMyInterface
{
void MyMethod (int myParam)
}
Now have your shopping cat control implement this;
public partial class cartTotal: System.Web.UI.UserControl, IMyInterface
And implement the MyMethod
void IMyInterface .MyMethod (int myParam)
{
// Update your control here
}
Then in your shoppingCart page;
IMyInterface myInterface = (IMyInterface ) Master.FindControl("cartTotal1");
myInterface.MyMethod (123);
"James Page" <Ja*******@discussions.microsoft.comwrote in message
news:51**********************************@microsof t.com...
How do i reference a control in the following scenario?
Master page has an ascx file which show the total items and value in a
shopping cart (using Profile data)
This needs to be updated when the cart is changed / amended.
The file structure =
master1.master with cartTotal.ascx with a label - lblTotal
shoppingCart.aspx with cart.ascx with events - CartGrid_RowUpdating etc
What i need to do is when the CartGrid_RowUpdating event fires i'd like to
reference the lblTotal in the cartTotal.ascx/ master1.master file and
update
its contents.
Any suggestions?