2017-05-16 9 views
1
私はページに2つの異なる値を渡したいが、それはリダイレクトされていないと私はエラー

asp.netでQuerystringを使用して複数のパラメータを渡すには?

を得る。この中

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); 
     } 
    } 

} 

入力文字列が正しい形式ではありませんでした。id = Convert.ToInt32(Request.QueryString["id"]);

提案がありますか?

+2

可能な重複[における複数のパラメータを渡す方法querystring](http://stackoverflow.com/questions/724526/how-to-pass-multiple-parameters-in-a-querystring) – Chirag

答えて

1

は、私はあなたが欠落していると思う「&」のURLで:

あなたは&文字でクエリ文字列のキーを分離する必要が
Response.Redirect("~/Pages/Product.aspx?id=" + id + "&Customize=" + custTotle); 
1

Response.Redirect("~/Pages/Product.aspx?id=" + id + "&Customize=" + custTotle); 
関連する問題