小编Ath*_*baN的帖子

如何向剃刀助手添加参数

我想知道HTML助手怎么样写@Html.TextBoxFor(model => model.signature)data-id辅助性生产中的输入参数如下图所示.

<input type="text" name="signature"  data-id="No Signature" />
Run Code Online (Sandbox Code Playgroud)

注1:参数之类dataId的工作是htmlAttributes因为它是一个简单的变量.

注2:我知道扩展方法和使用属性 @{var attributes = new Dictionary<string, object>{{ "data-id", "No Signature" }};}

我觉得必须有更好的方法来解决这个问题.任何的想法...?

非常感谢.

html c# asp.net-mvc html-helper razor

5
推荐指数
1
解决办法
1774
查看次数

标签 统计

asp.net-mvc ×1

c# ×1

html ×1

html-helper ×1

razor ×1