如何引用asp.net页面 [英] how to referesh the asp.net page

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

问题描述

如何在Response.OutputStream.Write之后执行页面刷新
这是代码

How to perform page refresh after Response.OutputStream.Write
This is the code

byte[] content = dr["FileContent"] as byte[];
                string filename = dr["FileName"].ToString();
                Response.Clear();
                Response.ClearContent();
                Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
                Response.AddHeader("Content-Length", content.Length.ToString());
                Response.OutputStream.Write(content, 0, content.Length);   


请帮帮我.......

如果我使用


pls help me.......

if i use the

response.redirect("sucess.aspx")


该页面突然重定向.....但是我想保存文件,然后将该页面重定向到另一个页面..

帮帮我...打开另存为"对话框后如何重定向...


the page is redirected suddenly....but i want to save the file and then the page is redirected to another page..

help me...how to redirect after the SaveAs dialog is opened......

推荐答案


试试这个

Page.Response.Redirect(Page.Request.Url.ToString(),true);

另外,您可以
Hi,
Try this

Page.Response.Redirect(Page.Request.Url.ToString(), true);

Alternatively you can
have only two ways of forcing a refresh. One is Javascript

setTimeout("location.reload(true);", timeout);
The second is a Meta tag:

<meta http-equiv="refresh" content="600">




要下载文件,您可以使用window.open方法.执行您的下载代码

Hi,

To download file you can use window.open method. execute your download code

byte[] content = dr["FileContent"] as byte[];
                string filename = dr["FileName"].ToString();
                Response.Clear();
                Response.ClearContent();
                Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
                Response.AddHeader("Content-Length", content.Length.ToString());
                Response.OutputStream.Write(content, 0, content.Length);



在window的新窗口中打开并刷新或重定向您的原始页面.

这将起作用.我在我的一个项目中尝试过,并且对我有用.



in new window by window.open and refresh or redirect you original page.

this will work. i tried this in my one project and it was worked for me.


我的response.write代码在代码的结尾运行.
但是最终您要重定向.
恐怕这是不可能的.但是您可以搜索是否有某种方式.
My response.write code runs in the end of the code.
But you are redirecting in the end.
I am afraid this is not possible.But you can search may be it have some way..


这篇关于如何引用asp.net页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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