问题描述
嗨。
我想在asp.net 4(C#)中重定向到服务器端的多个url。
当我写Response.redirect(url)3时在代码中的时间,首先重定向是有效的。
我该如何解决这个问题?
我的代码在下面并且没有正常工作。
protected void libraryButton_Click(object sender,EventArgs e)
{
// librarylist是CheckListBox
string url = libraryBox.Text;
string url1 = libraryBox1.Text;
string url2 = libraryBox2.Text;
if(librarylist.Items [0] .Selected)
Response.Redirect(url);
if(librarylist.Items [1] .Selected)
Response.Redirect(url1 );
if(librarylist.Items [2] .Selected)
Response.Redirect(url2);
}
谢谢。
hi.
I want to redirect to multiple url in server side in asp.net 4(C#).
When i write Response.redirect(url) 3 times in code, first redirect works.
how can i solve this problem?
my code is below and is not worke correctly.
protected void libraryButton_Click(object sender, EventArgs e)
{
//librarylist is CheckListBox
string url = libraryBox.Text;
string url1 = libraryBox1.Text;
string url2 = libraryBox2.Text;
if(librarylist.Items[0].Selected)
Response.Redirect(url);
if(librarylist.Items[1].Selected)
Response.Redirect(url1);
if(librarylist.Items[2].Selected)
Response.Redirect(url2);
}
thank you.
推荐答案
这篇关于按钮单击事件中的多个response.redirect(url)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!