如何在iis中打开html文件 [英] how to open a html file in iis

查看:115
本文介绍了如何在iis中打开html文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..

如何在c.asp.net中使用c#在按钮单击事件中打开存储在我的应用程序文件夹中的html文件.我已经在Visual Studio中使用process.start(compltefilepath)做到了这一点,但是它不起作用在iis

Hi..

How to open a html file which is stored in a folder in my application on button click event ,in asp.net using c# .i have done this in visual studio using process.start(compltefilepath)..but it won''t work in iis

推荐答案

尝试一下...

如果文件存储在应用程序路径中

背后的代码
Try this...

If the file is stored in application path

Code behind
protected void btnSubmit_click(object sender, EventArgs e)
{
    Response.Redirect("yourfile.html");
    Response.End();
}





<a href="SomePath\serverfile.html">
<a target="_blank" href="SomePath\serverfile.html"> //opens in new window
</a></a>



如果您希望用户打开其本地文件



If you want user to open their local file

window.location.href=document.getElementById(''textinput'').value;

//allow user to enter the full path along with filename




欢呼




cheers


在ASP中读取文本文件 [ http://www.coveryourasp.com/ShowFileDescr.asp [ http://www.asptutorial.info/learn/OpenReadCreate-files.html [ ^ ]
http://www.dotnetspark.com/kb/689-read-html-file-and-text-file-usign-asp-net.aspx[^]
Reading a text file in ASP[^]
http://www.coveryourasp.com/ShowFileDescr.asp[^]
http://www.asptutorial.info/learn/OpenReadCreate-files.html[^]


这篇关于如何在iis中打开html文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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