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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:46:15+00:00 2026-05-31T12:46:15+00:00

I am trying out the Editor Template in MVC 3 My model class is

  • 0

I am trying out the Editor Template in MVC 3

My model class is

public class BookViewModel
    {
        public int Id { get; set; }

        public string Name { get; set; }

        [DataType(DataType.Text)]
        public string Author { get; set; }
    }

I have create a partial view for Editor template and put that in a EditorTemplates folder with name Text.cshtml. following is the partial view

@inherits System.Web.Mvc.WebViewPage<string>
<p> Write the name of author</p> @Html.TextBox(Model)

and I used @Html.EditorFor in the view page

<p> Name : @Html.EditorFor(model => model.Name)</p>

<p> Author</p> @Html.EditorFor(model => model.Author) 

But when I run the program what I see is only an empty TextBox. I should see a TextBox filled with Author Name right?

What am I missing 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-05-31T12:46:16+00:00Added an answer on May 31, 2026 at 12:46 pm

    Your editor template should be:

    @model String
    <p> Write the name of author</p> @Html.TextBox("name of the textbox", Model)
    

    The first parameter of the @Html.TextBox() helper can be an empty string as well, but its not recommended

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

Sidebar

Related Questions

I have a custom class: public class Person { public String Name { get;
I'm trying out intelliJ's commercial editor with spring mvc 3.0 It seemed to have
So, I'm working with CKEditor and jQuery, trying to build a pop-out editor. Below
Trying out the examples found on pleac.sf.net , I'm not able to get an
So i'm trying out MVC after only playing with it some time ago. Need
I Just starting out w/ ASP.NET MVC 3 and I am trying to render
I am trying out creating Spring MVC app on SpringToolSuite (STS) IDE. I do:
I'm trying to figure out how to open the system preferred editor for a
I'm trying to find a token out of a string and return it. I
When I try to convert a string to int array, i get a Null

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.