ASP.NET MVC 2 - ViewModel Prefix

前端 未结 4 1665
栀梦
栀梦 2021-02-13 21:45

I want to use RenderPartial twice in my view with different models associated. The problem is that some properties are present in both models (nickname, password). They have no

4条回答
  •  北恋
    北恋 (楼主)
    2021-02-13 22:07

    Looks like there's an overload for TextBoxFor that allows you to specify extra HTML attributes. It isn't an ideal solution, but it should let you change the id (and possibly name?) of the rendered textboxes. Of course changing the name would probably screw things up when you try to post the form.

提交回复
热议问题