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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:09:24+00:00 2026-06-14T08:09:24+00:00

I render my ViewModel with Create.cshtml: @using (Html.BeginForm(Create,TestTemplate)) { @Html.EditorForModel() } I do not

  • 0

I render my ViewModel with

Create.cshtml:

@using (Html.BeginForm("Create","TestTemplate")) {      

    @Html.EditorForModel()
}

I do not like the output content because all the divs are one below the other. What if I want a horizontal layout where one div floats lefthandside to the other div?

How can I modify such layout changes using the EditorForModel() helper when there is no html in my Create.cshtml view ?

UPDATE:

Why do I have to create TWO views. In the one I call @Html.EditorForModel() in the other EditorTemplate-view I do all the layout stuff which I could also do within the first view via EditorFor( x => x….) ??? This seems strange to me.

  • 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-14T08:09:25+00:00Added an answer on June 14, 2026 at 8:09 am

    You want to create an EditorTemplate. Basically create a new folder called EditorTemplates in ~/Views/Shared and then create a new view within that folder that has the name of your model, e.g. Template.cshtml or whatever.

    When you call @Html.EditorForModel() it will use this view as the template.

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

Sidebar

Related Questions

I am trying to render a ViewModel using Razor and MVC3. For some reason
I am using jQuery.load() to render a partial view. This part looks like this:
I am using the following partial to render the editor for the Create and
I render all my surfaces to a buffer, then at the end of the
How to render partial view in some specific div without using ajax in asp.net
I want to render the partial view using ajax. When I submit the button,
since IE won't render XHTML as XHTML, but treat it as HTML instead, when
I have created a base viewmodel that all of my view models inherit from.
I've been using this tutorial to create a screen where a user can add
I've been using DisplayTemplates/EditorTemplates for relatively simple types, like DateTime and DateTime?, etc. Now

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.