Models\AccountForm.cs
public class AccountForm {
public string Name {get;set;}
}
Views\Shared\EditorTemplates\AccountForm.cshtml
@using Web.Models;
@model AccountForm
<p>
@Html.TextBoxFor(m => m.Name)
</p>
Will generate cs like
using Web.Models;
public class AccountForm : System.Web.Mvc.WebViewPage<AccountForm> {
}
And then it doesn't know which account form to use.
Can workaround by changing view to remove using and have
@model Web.Models.AccountForm
Comments: Most of these issues stem from us preferring to mangle names in a different way than how Mvc does it. For instance, Mvc generates type names which look like ``` namespace Asp { public class Views_Home__Partial_cshtml : WebViewPage ``` versus the names we generate look like ``` namespace Views.Home { public class Partial : WebViewPage ``` The primary incentive for doing this is to allow for cleaner types when using RazorGenerator.Testing. Given that this keeps throwing people off, it might be worthwhile to consider making this "cleaner" name generation an optional switch. @davidebbo, thoughts?
public class AccountForm {
public string Name {get;set;}
}
Views\Shared\EditorTemplates\AccountForm.cshtml
@using Web.Models;
@model AccountForm
<p>
@Html.TextBoxFor(m => m.Name)
</p>
Will generate cs like
using Web.Models;
public class AccountForm : System.Web.Mvc.WebViewPage<AccountForm> {
}
And then it doesn't know which account form to use.
Can workaround by changing view to remove using and have
@model Web.Models.AccountForm
Comments: Most of these issues stem from us preferring to mangle names in a different way than how Mvc does it. For instance, Mvc generates type names which look like ``` namespace Asp { public class Views_Home__Partial_cshtml : WebViewPage ``` versus the names we generate look like ``` namespace Views.Home { public class Partial : WebViewPage ``` The primary incentive for doing this is to allow for cleaner types when using RazorGenerator.Testing. Given that this keeps throwing people off, it might be worthwhile to consider making this "cleaner" name generation an optional switch. @davidebbo, thoughts?