1
我需要在新的asp.net页面或弹出页面中呈现xml文档。在浏览器vb.net中显示Xml文档
我下面的article
我收到以下错误"Thread was being aborted."
但XML文档中的页面呈现。
有没有更好的例子
Try
If Not String.IsNullOrEmpty(tempFilePath) Then
Response.Clear()
Response.Buffer = True
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "application/xml"
'Response.WriteFile(Server.MapPath(tempFilePath)) ' Todo Change path to temp location and add th
Response.WriteFile("c:\Test.xml")
Response.Flush()
Response.[End]()
End If
Catch ex As Exception
'TODO
Throw ex
End Try
请指定你得到该异常的行(请注意'Response.End'显式抛出异常作为中止当前线程的结果 - http://stackoverflow.com/questions/1087777/is-response-end-认为有害) –
谢谢你的工作,我用response.close替换了response.end。你可以添加一个答案。如果我需要在具有母版页的页面中呈现响应,我将如何执行此操作。 – user1339913