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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:08:07+00:00 2026-05-25T02:08:07+00:00

I am converting a MVC2 app to MVC3. I cannot seem to join up

  • 0

I am converting a MVC2 app to MVC3.
I cannot seem to join up a View with an Editor Template.
So in my View the code is;

@model IEnumerable<ITOF.Models.LatestContractNumber>

@{
    ViewBag.Title = "EditContractNumbers";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

using (Html.BeginForm())
       {
    <fieldset>
        <legend>Edit Latest Contract Numbers</legend>
        <div style="width:90%">
            <div style="width:45%; float:left; vertical-align:top;">
                <p>A contract number is in a format: AA/B999</p>
                <p>Where AA is a 2 character code for the division, for example CD.</p>
                <p>Where B is a letter for the contract, usually the first letter of the contract title.</p>
                <p>999 is a 3 digit number.</p>
                <p>The 999 number depends on the B letter. </p>
                <p>Initially all the numbers start as 1 and are incremented each time the B letter is used.</p>
                <p>This pages sets the initial 999 number for each B letter.</p>
                <p>Once the application is up and running, this page should be used initially and then no more.</p>  
                @if (TempData["Message"] != null && TempData["Message"].ToString().Trim().Length > 0)
                  { 
                  <p class="success">@TempData["Message"].ToString()</p>
                  }         
            </div>
            <div style="width:45%; float:right; vertical-align:top;">
                <div>
                <table>
                    <tr>
                        <td>Letter</td>
                        <td>Number</td>
                    </tr>
                    @Html.EditorForModel(Model)
                </table>
                </div>
                <div style="padding-top:20px">
                    <input type="submit" value="Submit Changes" />
                </div>
            </div>
        </div>
    </fieldset>
    }

And my Editor Template is in the correct folder and now looks like;

@model ITOF.Models.LatestContractNumber
<tr>
    <td>
        @Html.HiddenFor(model => model.LatestContractNumberId)
        @Html.DisplayFor(model => model.Letter) 
    </td>

    <td>
        @Html.TextBoxFor(model => model.Number, new { style = "width:30px" })
    </td>
</tr>

The Model in @Html.EditorForModel(Model) relates to @model IEnumerable at the top of the page.
In the Editor Template, this should translate to a loop of ITOF.Models.LatestContractNumber, hence at the top of the template I have put @model ITOF.Models.LatestContractNumber

  • 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-25T02:08:08+00:00Added an answer on May 25, 2026 at 2:08 am

    The question turned out to be a red herring. The real problem was that having migrated to MVC and started prefixing partial views with _, the name of the Editor Template was invalid.
    Thanks to Russ Cam for asking the right questions that got me the answer.

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

Sidebar

Related Questions

After converting a Hybrid ASP.NET MVC1 app to MVC2 I'm getting the following error
I'm converting an existing ASP.NET app to MVC2, and I have an existing method
Converting my current code project to TDD, I've noticed something. class Foo { public
When converting a project (in which a template method of IComparable was used a
I'm converting an old app that records folder sizes on a daily basis. The
In MVC2 template, I normally use this.ViewData.TemplateInfo.GetFullHtmlFieldId(fieldName) to generate the id field of an
Converting another app from Rails 2 to Rails 3 - in one of my
Converting an old vs2003 project to vs2010, and I've stumbled on one error: cannot
While converting a project that used SlimDX, and therefore has unmanaged code, to .NET
My view model is along the lines of EditViewModel SomeUserType User Dictionary<string, string> Claims

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.