内容简介:翻译自:https://stackoverflow.com/questions/26920431/invalid-anonymous-type-member-declarator-using-data-url-html-attribute
我正在使用jQuery创建一个小项目,使用Razon和C#创建MVC4.在我看来,我有一个下拉列表,我希望给它data-url = Url.Action(“UpdateDeliveryAddress”,“Home”)的属性:
<div class="@dropDownListClass">
@Html.DropDownList("theList", null, new {data-url=Url.Action("UpdateDeliveryAddress", "Home") })
</div>
但是,当我这样做时,我收到以下错误:
invalid anonymous type member declarator anonymous type members must be declared with a member assignemnt, simple name or member access.
我错过了什么?为什么我有这个错误?
data-url不是有效的C#标识符.
而是使用data_url.
MVC将用 – 替换_.
翻译自:https://stackoverflow.com/questions/26920431/invalid-anonymous-type-member-declarator-using-data-url-html-attribute
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:- JS声明对象时属性名加引号与不加引号的问题及解决方法
- 利用 xml.dom.minidom 生成 xml,解决属性无序问题和xml声明单独一行
- JS变量声明和函数声明提升
- JavaScript声明变量详解
- javascript的变量声明
- Go - 变量声明
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Distributed Systems
Sukumar Ghosh / Chapman and Hall/CRC / 2014-7-14 / USD 119.95
Distributed Systems: An Algorithmic Approach, Second Edition provides a balanced and straightforward treatment of the underlying theory and practical applications of distributed computing. As in the p......一起来看看 《Distributed Systems》 这本书的介绍吧!
CSS 压缩/解压工具
在线压缩/解压 CSS 代码
正则表达式在线测试
正则表达式在线测试