This is not my area, so please be gentle. This is a simple shopping basket system I knocked up in C# and VS2005 and runs on a Windows 2003 server.
The initial url is of the form: www.site.com/basket.aspx?addqty=1
And I have something like:
That all works. There's also a check box on the page (for VAT) and that has an OnClick handler:
The problem is if I go to the page via the addqty=1 link, and then click on the checkbox, it reloads the basket but does the addqty again. I assumed (perhaps naively) that because the redirect was to just "Basket.aspx", the Request variable would be empty on the next PageLoad. Is that correct? Or does the Request persist? Or is there something else going on - perhaps the browser is caching the request somehow?
Thanks for any help.
The initial url is of the form: www.site.com/basket.aspx?addqty=1
And I have something like:
Code:
protected void Page_Load(object sender, EventArgs e) { string addQty = Request["addqty"]; if (addQty != null) { m_basket.IncreaseItem(item); } // display basket and calculate totals... }
Code:
protected void CheckBox1_CheckedChanged(object sender, EventArgs e) { Session["VATOverride"]=1; Response.Redirect("Basket.aspx"); }
Thanks for any help.
Comment