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"]);
有什么建议吗?
最佳答案
你必须用 & 字符分隔查询字符串键
Response.Redirect("~/Pages/Product.aspx?id=" + id + "&Customize=" + custTotle);
关于c# - 如何在asp.net 中使用Querystring 传递多个参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43994746/