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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:00:24+00:00 2026-05-15T07:00:24+00:00

In ASP.NET MVC, there are these snippets of html called view templates which appear

  • 0

In ASP.NET MVC, there are these snippets of html called view templates which appear when their matching data appears on the screen. For example, if you have a customer order and it has a vendor address, the vendor address view template shows up populated with data.

Unfortunately, these don’t have access to “MasterPages” nor are aware of their CSS surroundings.

Instead of loading these up with style tags, is there any way to create partial CSS files that could work for that particular html snippet, a sort of in-line CSS style section?

It would be really nice to plop this down just before we render the partial view:

<style type="text/css">
    input { margin: .2em .2em;
            overflow: hidden;
            width: 18.8em; 
            height: 1.6em;
            border: 1px solid black;}
</style>

to have the 15 or so input fields in that particular Html snippet be formatted the same. These are swapped out, so the positions of the input fields change. This may also imply a CSS reset on each partial view.

  • 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-15T07:00:24+00:00Added an answer on May 15, 2026 at 7:00 am

    I thing that an idea would be to include an additional content section in Head of the master page

    <head runat="server">
        <title>
            <asp:ContentPlaceHolder ID="TitleContent" runat="server" />
        </title>
        <link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
        <asp:ContentPlaceHolder ID="CssContent" runat="server" />
    </head>
    

    In doing so, you can then inject the specific styles for each view.

    Edit: After posting I think the above is not what you are referring to. What you may consider is rolling your own ViewUserControl similar to Script & CSS Registration Helper in ASP.NET MVC??

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

Sidebar

Related Questions

In ASP.NET MVC there is Model, View and Controller. MODEL represents entities which are
In asp.net mvc there is ViewResult for returning a View and ActionResult for returning
There's so much hype about ASP.NET MVC these days, but the truth is that
I have converted my classic asp.net mvc views to razor. In a view there
In ASP.NET MVC there are generic master views ( ViewMaserPage<T> ). But what is
Is there an ASP.NET MVC portal that is either commercially available or open source?
There is a ASP.NET MVC 2 web app, lets call it myapp.com. I want
Using ASP.Net MVC 2, is there any way to use the RedirectToAction() method of
Is there an integrated way in asp.net mvc 3, to permit authentification and actions
Is there any way to render ASP.net MVC controls or code directly within a

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.