读书人

传值并跳转解决方法

发布时间: 2012-03-06 20:47:55 作者: rapoo

传值并跳转

C# code
if(!Page.IsPostBack)            {                this.txtsid.Text=Request.QueryString["sid"];                this.txtsname.Text=Request.QueryString["sname"];            }        }


C# code
[color=#FF0000]string url="addsoftwareupgrade.aspx?sid=" + txtsid.Text + "&sname=" + txtsname.Text ;                 Response.Redirect(url);[/color]                Response.Write("<script>if(confirm('此软件没有升级记录,是否添加?')){window.location.href='addsoftwareupgrade.aspx'};</script>");

怎么把url写在href里面啊。我弄了半天没弄出来,应该是符号的问题吧。

[解决办法]
string url="addsoftwareupgrade.aspx?sid=" + txtsid.Text + "&sname=" + txtsname.Text ;
Response.Write("<script>if(confirm('此软件没有升级记录,是否添加?')){window.location.href='"+url+"'};</script>");

读书人网 >asp.net

热点推荐