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 3945560
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:01:50+00:00 2026-05-20T01:01:50+00:00

In my MVC3 application I want to remove all HTML5 tags for the output

  • 0

In my MVC3 application I want to remove all HTML5 tags for the output when the user is using IE < 9 to avoid using a frontend workaround.

I’ve looked in to using a HttpModule, ActionFilter, the OnResultExecuted method on a controller and inside Application_Start.

I’ve figured so far that I need to get the output as a string from HttpApplication.Context.Response.OutputStream using something like:

HttpApplication application = (HttpApplication)source;
HttpResponse response = application.Context.Response;
StreamReader sr = new StreamReader(stream);
string content = sr.ReadToEnd();

But all I get is the same error Stream was not readable.
I can write to the response with context.Response.Write.

From reading around on SO and google, MVC doesn’t seem to have the same “page life cycle” has webforms(where I’m just overring Render and it works fine) which makes sens.

So my question is how do I get the HTML as a String in MVC? Have anyone tried to manipulate the html output?

  • 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-05-20T01:01:50+00:00Added an answer on May 20, 2026 at 1:01 am

    I think you should be able to use an ActionFilter to do this. I’ve seen an example of someone modifying the output stream in this blog post. or in this post.

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

Sidebar

Related Questions

I am using AJAX-enable web services in my ASP.NET MVC3 application and I want
Im want to create a data structure for using within my MVC3 application. The
I am implementing a web application using ASP.NET MVC3. In the application I want
We're using NLog for logging in an C# MVC3 web application. All of our
i am using telerik grid in my Asp.Net MVC3 application and i want to
For an MVC3 application I want to create a reusable DAL that is accessed
To improve performance of our MVC3 application we want to mark some Controller's to
I want to build an ASP.NET MVC3 application but instead of a model I
I'm working on a ASP.NET MVC3 web application and I want to create a
I am building a new asp.net MVC3 web application for reporting and I want

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.