Alter the HTML output before it's sent to the web browser, possible?

Discussion in 'ASP .Net' started by Brian Simmons, Jul 19, 2007.

  1. Hi,

    Long story short: I've got a website built, and we moved it over to the
    production server, which is an SSL-required (https://...) server.
    A third party component that I'm using makes use of an <iframe>.
    Unfortunately they set the SRC attribute to "".

    This causes Internet Explorer to display a message box dialog warning about
    this page contains non-secure and secure items, do you wish to display the
    non-secure items, Y/N?

    Very annoying as it happens on every page transition and having the
    end-users switch their IE settings is not an option.

    After some Googling, I discovered the ASP.net 2 menu control has the same
    issue and Jerry Orman has the problem/solution listed on his blog:
    http://blogs.msdn.com/jorman/archive/2006/02/06/526087.aspx

    I contacted the 3rd party component vendor and they confirmed this issue was
    a bug.

    I'm not sure how long it's going to take them to fix the bug, and I need it
    yesterday.

    So, I'm wondering if this solution is possible and if so, how/where would I
    do it?

    I would like to capture the HTML output right before ASP.net hands it off to
    IIS which sends it to the web browser.

    And in that event where I capture the rendered HTML, do something like:

    theHTMLOutput = theHTMLOutput.ToString().Replace(" src=\"\" ", "
    src=\"https://mysite.com/blank.htm\" ")

    Is it possible? Any tips/suggestions/code?

    Thanks,
    Brian
    Brian Simmons, Jul 19, 2007
    #1
    1. Advertising

  2. RE: Alter the HTML output before it's sent to the web browser, possibl

    Dino Esposito has an excellent post that explains exactly how you can do this:
    http://weblogs.asp.net/despos/archive/2004/06/01/145436.aspx
    Peter
    --
    Recursion: see Recursion
    site: http://www.eggheadcafe.com
    unBlog: http://petesbloggerama.blogspot.com
    bogMetaFinder: http://www.blogmetafinder.com



    "Brian Simmons" wrote:

    > Hi,
    >
    > Long story short: I've got a website built, and we moved it over to the
    > production server, which is an SSL-required (https://...) server.
    > A third party component that I'm using makes use of an <iframe>.
    > Unfortunately they set the SRC attribute to "".
    >
    > This causes Internet Explorer to display a message box dialog warning about
    > this page contains non-secure and secure items, do you wish to display the
    > non-secure items, Y/N?
    >
    > Very annoying as it happens on every page transition and having the
    > end-users switch their IE settings is not an option.
    >
    > After some Googling, I discovered the ASP.net 2 menu control has the same
    > issue and Jerry Orman has the problem/solution listed on his blog:
    > http://blogs.msdn.com/jorman/archive/2006/02/06/526087.aspx
    >
    > I contacted the 3rd party component vendor and they confirmed this issue was
    > a bug.
    >
    > I'm not sure how long it's going to take them to fix the bug, and I need it
    > yesterday.
    >
    > So, I'm wondering if this solution is possible and if so, how/where would I
    > do it?
    >
    > I would like to capture the HTML output right before ASP.net hands it off to
    > IIS which sends it to the web browser.
    >
    > And in that event where I capture the rendered HTML, do something like:
    >
    > theHTMLOutput = theHTMLOutput.ToString().Replace(" src=\"\" ", "
    > src=\"https://mysite.com/blank.htm\" ")
    >
    > Is it possible? Any tips/suggestions/code?
    >
    > Thanks,
    > Brian
    >
    >
    >
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Jul 19, 2007
    #2
    1. Advertising

  3. Re: Alter the HTML output before it's sent to the web browser, possibl

    Hi Peter,

    Thank you so much for Dino's blog post. It explained it pretty good, but by
    using keywords in his article I was able to find this article with code
    samples:
    http://aspalliance.com/71

    I implemented this technique on my site and it worked like a charm.

    Thanks again (you, Dino and aspalliance were my lifesavers today),
    Brian

    "Peter Bromberg [C# MVP]" <> wrote
    in message news:...
    > Dino Esposito has an excellent post that explains exactly how you can do
    > this:
    > http://weblogs.asp.net/despos/archive/2004/06/01/145436.aspx
    > Peter
    > --
    > Recursion: see Recursion
    > site: http://www.eggheadcafe.com
    > unBlog: http://petesbloggerama.blogspot.com
    > bogMetaFinder: http://www.blogmetafinder.com
    >
    >
    >
    > "Brian Simmons" wrote:
    >
    >> Hi,
    >>
    >> Long story short: I've got a website built, and we moved it over to the
    >> production server, which is an SSL-required (https://...) server.
    >> A third party component that I'm using makes use of an <iframe>.
    >> Unfortunately they set the SRC attribute to "".
    >>
    >> This causes Internet Explorer to display a message box dialog warning
    >> about
    >> this page contains non-secure and secure items, do you wish to display
    >> the
    >> non-secure items, Y/N?
    >>
    >> Very annoying as it happens on every page transition and having the
    >> end-users switch their IE settings is not an option.
    >>
    >> After some Googling, I discovered the ASP.net 2 menu control has the same
    >> issue and Jerry Orman has the problem/solution listed on his blog:
    >> http://blogs.msdn.com/jorman/archive/2006/02/06/526087.aspx
    >>
    >> I contacted the 3rd party component vendor and they confirmed this issue
    >> was
    >> a bug.
    >>
    >> I'm not sure how long it's going to take them to fix the bug, and I need
    >> it
    >> yesterday.
    >>
    >> So, I'm wondering if this solution is possible and if so, how/where would
    >> I
    >> do it?
    >>
    >> I would like to capture the HTML output right before ASP.net hands it off
    >> to
    >> IIS which sends it to the web browser.
    >>
    >> And in that event where I capture the rendered HTML, do something like:
    >>
    >> theHTMLOutput = theHTMLOutput.ToString().Replace(" src=\"\" ", "
    >> src=\"https://mysite.com/blank.htm\" ")
    >>
    >> Is it possible? Any tips/suggestions/code?
    >>
    >> Thanks,
    >> Brian
    >>
    >>
    >>
    Brian Simmons, Jul 19, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ron Vecchi
    Replies:
    4
    Views:
    483
    Jacob Yang [MSFT]
    Oct 31, 2003
  2. PJ6
    Replies:
    2
    Views:
    476
  3. jchen8000
    Replies:
    0
    Views:
    359
    jchen8000
    Apr 3, 2009
  4. -berlin.de
    Replies:
    0
    Views:
    136
    -berlin.de
    Jun 30, 2007
  5. Jeremy

    Alter Form values before submission

    Jeremy, Nov 17, 2005, in forum: Javascript
    Replies:
    1
    Views:
    74
Loading...

Share This Page