gpt4 book ai didi

asp.net-mvc-2 - Asp.net MVC标签

转载 作者:行者123 更新时间:2023-12-04 04:56:10 24 4
gpt4 key购买 nike

我有以下

 <label for="Forename">Forename</label>
<%= Html.TextBoxFor(m => m.Customer.Name.Forename) %>

这个问题是,这被渲染为

<label for="Forename">Forename</label>
<input type="text" value="" name="Customer.Name.Forename" id="Customer_Name_Forename">

不是我想要的。

我想要一个扩展来正确呈现标签(即,使用具有输入ID值的for =“”属性),在我编写自己的扩展之前,MVC 2中是否有什么可以天真地做到这一点?

最佳答案

<%= Html.LabelFor(m => m.Customer.Name.Forename) %>
<%= Html.TextBoxFor(m => m.Customer.Name.Forename) %>

关于asp.net-mvc-2 - Asp.net MVC标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2595947/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com