Reputation: 13
protected void btnBack_Click(object sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(Request.QueryString["id"]))
{
int id = Convert.ToInt32(Request.QueryString["id"]);
if (custTotle == 0)
{
Response.Redirect(prevPage);
}
else
{
Response.Redirect("~/Pages/Product.aspx?id=" + id + "Customize=" + custTotle);
}
}
}
In this I want to pass two different values to the page but it is not redirecting and I get the error
"Input string was not in a correct format."
at id = Convert.ToInt32(Request.QueryString["id"]);
Any suggestion?
Upvotes: 1
Views: 9396
Reputation: 1324
You have to separate query string key by & character
Response.Redirect("~/Pages/Product.aspx?id=" + id + "&Customize=" + custTotle);
Upvotes: 2
Reputation: 696
I guess your missing a "&" in the url:
Response.Redirect("~/Pages/Product.aspx?id=" + id + "&Customize=" + custTotle);
Upvotes: 1