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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:38:02+00:00 2026-05-27T14:38:02+00:00

In _Layout.cshtml I have the following defined in the tag: @RenderSection(JavaScript, required: false); The

  • 0

In _Layout.cshtml I have the following defined in the tag:

@RenderSection("JavaScript", required: false);

The whole thing looks like this:

<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>

    @RenderSection("JavaScript", required: false);

</head>

Now in a view’s Index.cshtml I have:

@section JavaScript
{
    <style type="text/css" title="currentStyle">
        @@import "table/media/css/demo_page.css";
        @@import "table/media/css/demo_table.css";
    </style>
}

But on the line that ‘element style must not be nested in element style’.

Not sure why this is, anyone have any ideas?

  • 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-27T14:38:03+00:00Added an answer on May 27, 2026 at 2:38 pm

    Normally you should use url with @import:

    @section JavaScript
    {
        <style type="text/css" title="currentStyle">
            @@import url("table/media/css/demo_page.css");
            @@import url("table/media/css/demo_table.css");
        </style>
    }
    

    or use the link tag with href:

    @section JavaScript
    {
        <link href="@Url.Content("~/table/media/css/demo_page.css")" rel="stylesheet" type="text/css" />
        <link href="@Url.Content("~/table/media/css/demo_table.css")" rel="stylesheet" type="text/css" />
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a top-level _Layout.cshtml that looks something like this: <html> <head> @RenderSection(Header, required:
I have following code snipped in _Layout.cshtml <div id=sub-navig-container> @RenderSection(subNavig) </div> <div id=text-content> @RenderBody()
I am using an mvc application and in _Layout.cshtml page I have some javascript
I use @RenderSection(Contextual, false) within my _Layout.cshtml to allow different views to render their
I have _Layout.cshtml defined for my mvc application, which is shown below: @inherits System.Web.Mvc.WebViewPage
I have an Index.cshtml view: @model AttendenceModel @{ Layout = ~/Views/Shared/_Layout.cshtml; } @using (Html.BeginForm(VisOppsummering,
i have a master page called layout.cshtml and a page called testpage.cshtml. On this
Let's say I have a javascript slide-show in a partial view... _Slideshow.cshtml: @{ ViewBag.Title
I have a javascript function that works as I would like : <script language=javascript
I created an area named Admin. In /Areas/Admin/Views/, I have _ViewStart.cshtml with this: @{

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.