SVG/ ASP.NET integration Issue

hello all--

just recently got into the world of svg, an xml grammar. it is quite cool but i seemed to have gotton stuck on the first hurdle. I'm trying to output some svg to an aspx page from an aspx.vb page. Using visual studio 2002 to develop. Im told you just need to set the content type of the response object to "image/svg+xml". Then simply output as follows: Response.Write("").

The problem lies in when i go to view the page (on IE 6.0). I am presented with a pop-up:

you are downloading the file:
Webform1.aspx from localhost
would you like to open the file or save it to your computer?

When i choose 'open' the files source code is opened in visual studio. when i choose 'save' the svg src code is saved as svg doc.

Can anyone please tell me why this is happening? Shouldn't the svg just render in the browser as normal? Im totally confused as to why. (note: also tried this with firefox and the browser stalls on me. Even more strange, pure svg files render normally in both browsers!, the problem is when i attempt to generate the svg from an aspx.vb page! I've also set the MIME type on the server to match, "image/svg+xml".




the code is straightforward:




Private Sub btnSvg_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSvg.Click

Response.ContentType = "image/svg+xml"
Response.Write("")
Response.Write("")
Response.Write(" ")
Response.Write("")
Response.Write("")
Response.Write("")
Response.Write("")
Response.Write("")
Response.Write("")
Response.Flush()
Response.End()
End Sub



any help on this matter is greatly appreciated.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories