using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class ucProductPanel : System.Web.UI.UserControl { protected string BasketCopy = ""; /****************************************************************************************************/ /// /// Handles the Load event of the Page control. /// /// The source of the event. /// The instance containing the event data. protected void Page_Load(object sender, EventArgs e) { //if (!IsPostBack) SetBasketLink(); } /****************************************************************************************************/ /// /// Sets the basket link. /// private void SetBasketLink() { clsBasket basket = new clsBasket(); int Count = basket.CountItems(); if (Count > 0) { hlBasket.NavigateUrl = "Shopping-Basket.aspx"; BasketCopy = Count.ToString() + " item"; if (Count > 1) BasketCopy += "s"; BasketCopy += " in your basket. Click here to edit & checkout"; } else { hlBasket.NavigateUrl = "Order-Now.aspx"; BasketCopy = "Your Basket is empty!
Click here to order now"; } } /****************************************************************************************************/ /// /// Updates the links. /// public void UpdateLinks() { SetBasketLink(); } }