Quantcast
Channel: RazorGenerator Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 525

Commented Issue: MSBuild task fails when Model name same as partial name [38]

$
0
0
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: Yes, I agree. Maybe by default it should just use the same names as what Razor normally uses, and we'd have a flag to use our cleaner names. @pranav: can you point to the relevant code? Maybe someone else here will want to take a crack as sending a pull request for it.

Viewing all articles
Browse latest Browse all 525

Trending Articles