1
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?

Martin Braun
  • 10,906
  • 9
  • 64
  • 105
  • 2
    Possible duplicate of [How to pass multiple parameters in a querystring](http://stackoverflow.com/questions/724526/how-to-pass-multiple-parameters-in-a-querystring) – Chirag May 16 '17 at 07:59

2 Answers2

2

You have to separate query string key by & character

Response.Redirect("~/Pages/Product.aspx?id=" + id + "&Customize=" + custTotle);
Bhuban Shrestha
  • 1,304
  • 11
  • 27
1

I guess your missing a "&" in the url:

Response.Redirect("~/Pages/Product.aspx?id=" + id + "&Customize=" + custTotle);
Raz Zelinger
  • 686
  • 9
  • 24