如何在asp.net中重定向后刷新网页 [英] How to refresh a webpage after redirection in asp.net

查看:66
本文介绍了如何在asp.net中重定向后刷新网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,



我有两页

1)添加记录

2)新注册



我想在asp.net中重定向页面时只刷新一次新注册页面。

重定向来自add的网址记录页面。



这是我的代码。



ScriptManager.RegisterStartupScript(this,this.GetType( ),RunCode,javascript:alert('Application Submitted Successfully'); window.close(),document.location.href ='NewRegistration.aspx';,true);



我想在重定向后刷新NewRegistration页面。



请帮助,谢谢

Dear Friends,

I have two pages
1) Add Records
2) New Registration

I want to Refresh the New Registration page only once when am redirecting the page in asp.net.
am redirecting the url from add records page.

This is my Code.

ScriptManager.RegisterStartupScript(this, this.GetType(), "RunCode", "javascript:alert(' Application Submitted Successfully');window.close(),document.location.href='NewRegistration.aspx';", true);

I want to Refresh NewRegistration Page after Redirecting.

Please help, thanks

推荐答案



从您的代码中可以看出,您正在关闭窗口并期望其他窗口打开NewRegistration.aspx页面。



首次加载页面时,您无需刷新页面。在这里你删除window.close并检查你需要什么工作正常。



ScriptManager.RegisterStartupScript(this,this.GetType(),RunCode,javascript:alert('Application Commitmitted Successfully'); document.location.href = 'NewRegistration.aspx';,true);



希望你得到你想要的东西



问候,

Prasath SJ
Hi,
It seems from your code, you are closing the window and expecting other window to open the "NewRegistration.aspx" page.

You dont have to refresh your page as the page is loading for the first time. here your remove the window.close and check what you required is working fine.

ScriptManager.RegisterStartupScript(this, this.GetType(), "RunCode", "javascript:alert(' Application Submitted Successfully');document.location.href='NewRegistration.aspx';", true);

Hope you get what you want

Regards,
Prasath S J


这篇关于如何在asp.net中重定向后刷新网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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