如何使用asp.net在对话框中单击按钮时从一页重定向到另一页 [英] how to redirect from one page to another on button click from dialog box using asp.net

查看:63
本文介绍了如何使用asp.net在对话框中单击按钮时从一页重定向到另一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个显示onbuttonclick对话框的应用程序.

此对话框包含文本框&按钮.
现在,我想通过单击按钮的文本框将值重定向到另一页.

对于重定向,我编写了以下代码

I write one application in which onbuttonclick dialog box is displayed.

This dialog box contains text box & button.
Now I want to redirect to another page with value from text box on button click.

For the redirect I write following code

protected void btnDisplay_Click(object sender, EventArgs e)
    {
        string strName;
        string strCountry;
        strName=txtName.Text;
        strCountry = ddlName.Text;
        Response.Redirect("Next.aspx?name=" + strName + "&country=" + strCountry);
    }




但是,当我单击按钮时,我无法进入下一页.

我该怎么办?

谢谢.




But when I click on the button I cannot go to next page.

What am I to do?

Thanks.

推荐答案

我想您想关闭对话框并重定向父页面,对吗?您可以为此调用一些javascript.

像这样的东西:
I guess you want to close the dialog and redirect the parent page, right? You could invoke some javascript for that.

Something like:
Response.Write("<script>parent.location.href = ''http://someurl.here'';")



另外,在这里看看:
http://www.webdeveloper.com/forum/archive/index.php/t- 15245.html [^ ]

http://weblogs.asp.net/ksamaschke/archive/2003/02/23/2831.aspx [ ^ ]

祝你好运!



Also, have a look here:
http://www.webdeveloper.com/forum/archive/index.php/t-15245.html[^]

http://weblogs.asp.net/ksamaschke/archive/2003/02/23/2831.aspx[^]

Good luck!


这篇关于如何使用asp.net在对话框中单击按钮时从一页重定向到另一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆