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?

1

2 Answers 2

2

You have to separate query string key by & character

Response.Redirect("~/Pages/Product.aspx?id=" + id + "&Customize=" + custTotle);
Sign up to request clarification or add additional context in comments.

Comments

1

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

Response.Redirect("~/Pages/Product.aspx?id=" + id + "&Customize=" + custTotle);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.