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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:37:43+00:00 2026-05-15T23:37:43+00:00

I am using ASP.NET MVC 2 & C#. I want to include/embed an html

  • 0

I am using ASP.NET MVC 2 & C#.

I want to include/embed an html page (raw text & styling; no forms) in one of my views as is without my own css styling (read: The site.css styles for the ASP.NET MVC 2 application itself) affecting it. I can access the page statically and open it in a new window and it retains it’s styling; however, if I do:

<asp:Content ID="loginContent" ContentPlaceHolderID="MainContent" runat="server">
    <!--#include virtual="~\Static\Instructions.htm" -->
</asp:Content>

The styling from the html & the site.css in the web application seem to get merged.

I’ve added the following ignore route entries as well:

routes.IgnoreRoute("{resource}.html/{*pathInfo}");

I also tried making a partial view control with the raw html in it and rendering that here. That gives the exact same results as this.

Thoughts?

  • 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-15T23:37:43+00:00Added an answer on May 15, 2026 at 11:37 pm

    When you include a file with the code above, it’s like appending the entire data into the original file, as if there was no include at all. Doing it this way, you will inherit all relative JavaScript and CSS that is on the parent file.

    The only way you can solve this is by creating a wrapper around your main content and setting all the CSS elements to affect that wrapper only. Aside from that, the only other option is setting a CSS style for your appended file with specific IDs or clean up your current CSS to be more specific.

    One final method, if you have CSS affecting the included file (I assume from your OP, you have CSS styling inside the file itself), you can set !important to them so that they overwrite any other CSS classes affecting them.

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

Sidebar

Related Questions

i am using asp.net mvc 3. in one my of page. i need to
I am using asp.net MVC. I have control like <%= Html.TextBox(username) %> I want
In ASP.net MVC I am using Url.RouteUrl & Html.RouteLink to create some links in
I am using Asp.net MVC 3 and Twitter Bootstrap. What I want is to
Using ASP.NET MVC & Spark, I have a view that is listing a number
I am using ASP.NET MVC 2 & 3 with aspx View not Razor View,
Using ASP.NET MVC, Entity framework, jQuery. I want to give users the ability to
I am using membership in asp.net mvc 2 and i want to restrict users
I have an ASP.NET MVC Page along with Zipcode, Phonenumber & Fax. Now i
Using Asp.net MVC, I have one view that's strongly bind to List , and

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.