c# - How to close current Browser window and redirect to a previously opened window for the same browser - Stack Overflow

i have two asp page,first one is home and second one is test. In home page user can select the type of

i have two asp page,first one is home and second one is test. In home page user can select the type of test they want to take up, and after pressing start button a new window is open for taking the test. What i want to achieve is , after pleting the test i want to close the test window and redirect to another page, and this redirect should hit the previously opened home window.

i have two asp page,first one is home and second one is test. In home page user can select the type of test they want to take up, and after pressing start button a new window is open for taking the test. What i want to achieve is , after pleting the test i want to close the test window and redirect to another page, and this redirect should hit the previously opened home window.

Share Improve this question asked Oct 5, 2013 at 10:48 NiarNiar 5402 gold badges11 silver badges25 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 4

You don't clarify that you have popup window or blank window i am aspecting for the popup In submit click button press

String x = "<script type='text/javascript'>window.opener.location.href='**Your new url of new page after pleting test**';self.close();</script>";
ScriptManager.RegisterClientScriptBlock(this.Page,this.Page.GetType(), "script", x,false);

From self close you will be able to close current window and by window.opener.location.href you will able to redirect to new url I hope this will help you

regards....:)

Yes you can do these 2 ways:

  1. Window.Open() /.showmodalDialog() and keep parent and child open as well, or

  2. On the home page click on your start button. Use code Response.Redirect("~/Test.aspx"); assuming it resides with Home.aspx. Take your test using ASp.Net wizard control or hiddens divs what ever suits you easy. Manipulate data on test page , save and get result to and from database using SqlConnection and SqlCommand assuming you have Sql Server as backend. Hold the table or any value in either cache or Session and throw it on your home page. Do whatever you want.

This will be not possible. What you can do is to redirect the user to the home page after pleting the test, but this will be in the same windows.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744903482a4600116.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信