通过asp.net应用程序打开.svg文件 [英] Opening .svg file through asp.net application

查看:124
本文介绍了通过asp.net应用程序打开.svg文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
创建应用程序时,我希望单击一下按钮即可打开我的svg文件.
该文件位于本地目录中.....
但是当我的应用程序启动时,我只能看到部分文件(只能看到框架,看不到任何工具或按钮)..
我正在使用IE9和Visual Studio 2010....
请帮助我........
谢谢你.....
这是我的代码:

Hi everyone,
While creating an application, i want my svg file to be opened on a button click.
The file reside in a local directory.....
but when my application starts i can see only partial file (only frames can be seen, no tools or button can be seen)..
I''m using IE9 and Visual Studio 2010....
Please Help Me.................
Thank u........
Here is my Code:

protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("Smarth.aspx?.svg");
    }

推荐答案

亲爱的朋友,

我相信,问题在于您可以使用HTML进行尝试.您将需要使用XHTML.

有关更多详细信息:- http://bytes.com /topic/xml/answers/889278-why-my-svg-file-not-displaying-my-browser [ http://www.codeguru.com/csharp/csharp/cs_graphics/drawing/article. php/c19577 [ ^ ]

希望这些链接能帮助您解决问题.

谢谢
Dear Friend,

I believe, the problem is that you try it with HTML. you would need to use XHTML.

For more details:- http://bytes.com/topic/xml/answers/889278-why-my-svg-file-not-displaying-my-browser[^]

http://www.codeguru.com/csharp/csharp/cs_graphics/drawing/article.php/c19577[^]

I hope these links will help you solve your problem.

Thanks


亲爱的朋友,

请确保启用.svg扩展名MIME类型.默认情况下,IIS 6.0仅允许某些文件扩展名(例如.html,.txt)来提高安全性. .svg扩展名的请求失败,因为未在IIS中注册.因此,请参考以下步骤进行添加.

1.打开IIS管理器.
2.右键单击要允许.svg文件的网站,然后选择属性".
3.单击"HTTP标头"选项卡.
4.单击属性对话框底部的"MIME类型"按钮.
5.在已注册文件类型"列表中添加.svg扩展名及其类型.

有关HTTP 404错误情况的更多信息,请返回以下链接:

IIS服务器返回"HTTP 404-找不到文件"错误的常见原因

http://support.microsoft.com/kb/248033 [ 3.单击主目录"(对于网站)或虚拟目录"(对于Web应用程序)选项卡.
4.单击配置..."按钮.
5.添加.svg文件的映射.

有关此方案的更多信息,请参考以下链接:

IIS 6.0 F1:添加/编辑应用程序扩展名映射(用于应用程序扩展名)

http://technet2.microsoft.com/windowsserver2008/zh/library/4f289818-a796-4329-af3c-5d7b594f25ec1033.mspx?mfr = true [
Dear Friend,

Please ensure that the .svg extension MIME type is enabled. By default IIS 6.0 only allows certain file extensions such as .html, .txt to increase security. The request for .svg extension fails because is not registered in IIS. Hence, please refer the following steps to add it.

1. Open IIS manager.
2. Right click the website which you want to allow .svg file, and then select "Properties".
3. Click the "Http Headers" tab.
4. Cllick the "MIME types" button which on the botton of the property dialog.
5. Add .svg extension and its type in the "Registered file types" list.

For more informaiton about HTTP 404 error scenarios, please rerfer to the following link:

Common reasons IIS Server returns "HTTP 404 - File not found" error

http://support.microsoft.com/kb/248033[^]

In addtion, since you want to let ASP.NET to handle the .svg file, you should also register IIS mapping for the .svg file, Then IIS will route the request for .svg file to ASP.NET ISAPI.

1. Open IIS manager.
2. Right click the website you want to route request for .svg file to ASP.NET ISAPI, and then select "Properties".
3. Click the "Home Directory" (for website) or "Virtual Directory" (for web application) tab.
4. Click the "Configuration…" button.
5. Add the mapping for .svg file.

For more information about this scenario, please refer to the following link:

IIS 6.0 F1: Add/Edit Application Extension Mapping (for Application Extensions)

http://technet2.microsoft.com/windowsserver2008/en/library/4f289818-a796-4329-af3c-5d7b594f25ec1033.mspx?mfr=true[^]

I hope this solution will work for you.

Thanks


这篇关于通过asp.net应用程序打开.svg文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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