如何使用asp.net在对话框中单击按钮时从一页重定向到另一页

编程入门 行业动态 更新时间:2024-10-12 05:48:42
本文介绍了如何使用asp在对话框中单击按钮时从一页重定向到另一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我编写了一个显示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 = ''someurl.here'';")

另外,在这里看看: www.webdeveloper/forum/archive/index.php/t- 15245.html [^ ] weblogs.asp/ksamaschke/archive/2003/02/23/2831.aspx [ ^ ] 祝你好运!

Also, have a look here: www.webdeveloper/forum/archive/index.php/t-15245.html[^] weblogs.asp/ksamaschke/archive/2003/02/23/2831.aspx[^] Good luck!

更多推荐

如何使用asp.net在对话框中单击按钮时从一页重定向到另一页

本文发布于:2023-11-06 03:23:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1562600.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   单击   重定向   按钮   对话框中

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!