I had a problem with a simple error notification when uninstalling a specific product.
I have one page products.aspx I have 2 categories - Mobile (cat 1) - Net (cat 2)
When I delete a certain product from a certain category, I get a notification “your product has been deleted ...”, and then after 2 seconds I want to refresh the current page, therefore a new and correct number of products. My problem is that I request a querystring "deleteid" when deleting a product, and then my query with a "category" of course is 0. In general, I need "products.aspx? Categoryid = 2" to update, but categoryid has value 0 when "deleteid" is requested.
I still have it, I hope you understand and can help me ... Thank you!
... listing products by category (Request.QueryString["categoryid"])
... Then deleting by id, (Request.QueryString["deleteid"])
... and now my problem and what I have so far:
var query = Request.QueryString["deleteid"];
if (query.HasValue())
{
DeleteSpecificProduct(query.Int16());
errornotification.Text += @"Your product has been deleted";
var categoryid = Request.QueryString["categoryid"].Int16();
var url = String.Format("products.aspx?categoryid={0}", categoryid);
Response.AppendHeader("REFRESH", "2;URL=" + url);
}
//Thank
source
share