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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:30:08+00:00 2026-06-12T14:30:08+00:00

I am new to ASP.Net MVC and have always been using Web Forms till

  • 0

I am new to ASP.Net MVC and have always been using Web Forms till now. I have found Replacement for ITemplate in MVC? which gives an example of creating an HTML helper named BeginBlock which wraps the title & content from:

@using (Html.BeginBlock("MY TITLE")) {
       MY CONTENT GOES HERE
}

to

<div>
  <div><h1>MY TITLE</h1></div>
</div>
MY CONTENT GOES HERE

I have a scenario where in Web Forms, we used to use multiple ITemplates to define containers within user controls which we then wrapped inside HTML, for example, in Web Forms, we could create a user control named Panel and have two ITemplate properties, one named Content and the other named ContentNonScrollable. We would then use the user control by using the following markup:

<MySite:Panel>
    <Content>
        Content 1 Goes Here
    </Content>
    <ContentNonScrollable>
        Content 2 goes here
    </ContentNonScrollable>
</MySite:Panel>

The user control would then output the following, HTML:

<div class="my-panel">
    <div class="my-panel-content">
        Content 1 Goes Here
    </div>
    <div class="my-scrollable-panel-content">
        Content 2 Goes Here
    </div>
</div>

Is there any way in MVC, where through HTML Helpers (or anything else), we can devise something equivalent to the above Web Forms example through markup within the .cshtml template file?

For example something like (obviously, the below doesn’t have correct syntax, just to explain what we have in mind):

@using (Html.BeginPanel() {
       {
            Content 1 Goes Here
       }
       {
            Content 2 Goes Here
       }
}
  • 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-06-12T14:30:09+00:00Added an answer on June 12, 2026 at 2:30 pm

    You can use sections for this. Sections are designed for layouts (ie master pages) but you can nest master pages to create sectioned areas.

    But, it sounds like you want to do this as a control of some type. Another option might be Templated Razor Delegates

    Another option is Editor/Display Templates, although this isn’t typically markup-only. You would use variables to pass the content.

    Another option is just using a Partial View, and using ViewData to pass in the context sections.

    There are actually a lot of different ways you can go about this, and which way you choose depends on your needs. Can you explain the specific circumstances?

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

Sidebar

Related Questions

I'm new to ASP.NET MVC so this could have an obvious answer. Right now
With ASP.NET MVC 1.0 I always have been able to generate strongly typed links
I have a new ASP.NET MVC project (my first), and I had been running
I have a new asp.net mvc project and i am trying to figure out
I am new to asp.net mvc and i have problems that i think i
I have created the following project structure for my new asp.net mvc project any
i'm new in the asp.net mvc development and have a quastin about the standart
I'm new in ASP.NET MVC, I have many actions in my controllers, so they
I am new to ASP.NET MVC 3 and I want to have username/id as
I am new to ASP.net MVC architecture. I have read in some articles that

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.