Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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:
C#
protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("Smarth.aspx?.svg");
    }
Posted
Updated 17-Feb-12 22:20pm
v2

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
 
Share this answer
 
Comments
EqEditor 18-Feb-12 4:38am    
@Varun: Thanx for replying....
I went through the first link... that is working fine in my system but not my application....
I want to integrate smarth editor in asp.net applicationn the file of smarth is in .svg format
so do not know how will it work
Also need to know does smarth support in IE8??
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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900