how to get/trace asp.net outgoing response text

前端 未结 2 391
半阙折子戏
半阙折子戏 2021-01-24 11:56

my server seems to be sometimes returning wrong html to webclients

im using asp.net 4 with VS 2012. debugging on IIS Express.

in order to debug this issue, id li

2条回答
  •  天涯浪人
    2021-01-24 12:51

    this does not answer my original question technically, but it does solve the issue i was having

    the problem was that the html wasnt rendering correctly

    i now remembered that aspx has adaptive rendering, so i fgured the useragent used in the request might be to blame

    i changed my code to:

     Dim myReq As HttpWebRequest = WebRequest.Create(MailUrl)
     myReq.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1"
     Dim resp As HttpWebResponse = myReq.GetResponse
     Dim stream = resp.GetResponseStream
     Dim rdr = New StreamReader(stream)
     Dim BodyText = rdr.ReadToEnd
    

    and now the html is rendering in correct modern Html5/Css3 markup

    i appreciate your help and guidance.

提交回复
热议问题