Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8869753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:33:20+00:00 2026-06-14T17:33:20+00:00

my server seems to be sometimes returning wrong html to webclients im using asp.net

  • 0

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 like to trace the html that asp.net is sending

in the Global_asax_PreRequestHandlerExecute i can access the response code and status, but cant seem to find the body html

i tried to read the OutputStream like this:

Dim ms = New MemoryStream
CurContext.Response.OutputStream.CopyTo(ms)
Dim sr = New StreamReader(ms)
Dim rtext = sr.ReadToEnd

but that throws a NotSupportedException Stream does not support reading.

any ideas?

thanks a lot

EDIT

i now tested this for sure

i have a label on the page with the following attributes

<asp:label id="l" runat="server" Font-Bold="true" Font-Size="X-Large" BackColor="Pink"/>

when displayed in the browser it shows just fine, as follows:

<span id="C1_FormView1_l" style="background-color:Pink;font-size:X-Large;font-weight:bold;">Processed</span>

but when downloaded with webclient i get

<span id="C1_FormView1_l"><b><font size="6">Processed</font></b></span>

why is the backcolor lost? and btw, why doesn’t it use the more modern style attribute instead of adding b and font

if i could read the ResponseStream i would at least know WHERE it gets lost, even that i dont know now.

thank you very much

P.S. if .net 4.5 is better for this, then i might consider changing the target framework

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:33:22+00:00Added an answer on June 14, 2026 at 5:33 pm

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It seems that SQL Server does not accept numbers formatted using any particular locale.
It seems that WMD-Editor is posting HTML to the server instead of the markdown.
It seems that using Critical Sections quite a bit in Vista/Windows Server 2008 leads
Sometimes boost::asio seems to disconnect before I want it to, i.e. before the server
I'm seeing this error in my production server, sometimes (I mean, it seems random,
I have a website using Microsoft SQL 2008 server over local network. Sometimes, SQL
I need to export some data using SQL Server 2000's BCP utility. Sometimes my
My CI site will sometimes just hang - server seems to take forever to
I have an IIS server which serves a search page using SolrNet. The search
My rails server seems to break after installing the facebooker plugin. Any suggestions on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.