简体   繁体   English

错误名称“标识符”在当前上下文中不存在

[英]Error The name 'Identifier' does not exist in the current context

I have C# enumeration 我有C#枚举

public enum Item
{
    Identifier = 0,
    Title = 1,
    StartOfMedia = 2,
    Duration = 3,
    Content = 4,
    EOM = 5,
    FirstAirDate = 6,
    BoxId = 7,
    Seg = 8,
}

And JavaScript code where enumeration is used 以及使用枚举的JavaScript代码

<script type="text/javascript">
    function updateFieldStatus() {}
    var Identifier = "";
    Identifier = @Item.Identifier.ToString();
    $(document).ready(function () {
            $("#Configuration").validate({
                rules: {
                    "config.Format["@Identifier"].StartPos":
            {
                required: true,
                digits: true,
                range: [1, 200]
            }, },
            }); 
    });
</script>

But I have Error: 但是我有错误:

"The name 'Identifier' does not exist in the current context" “名称“标识符”在当前上下文中不存在”

What I do wrong? 我做错了什么?

尝试:

  "config.Format["+Identifier+"].StartPos":

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:名称“RGGSTAcCode”在当前上下文中不存在 - Error: The name 'RGGSTAcCode' does not exist in the current context 在asp.net中,当前上下文错误中不存在名称“Url” - The name 'Url' does not exist in the current context error in asp.net 名称“ ui”在当前上下文中不存在 - The name 'ui' does not exist in the current context “ScriptManager”名称在当前上下文中不存在 - The name 'ScriptManager' does not exist in the current context “ClientScript”这个名称在当前上下文中不存在 - The name 'ClientScript' does not exist in the current context 名称“功能”在当前上下文中不存在 - The name '“function” does not exist in the current context 名称“内容”在当前上下文中不存在 - The name 'content' does not exist in the current context 名字 &#39; <name> 在MVC 4.0的当前上下文中不存在&#39; - The name '<name>' does not exist in the current context on MVC 4.0 对于For Java Script C#Web App,当前上下文中的名称“ serializer”不存在。 - The name 'serializer' does not exist in the current context Master Page Error in For Java Script C# Web App CS0103:名称“”在当前上下文中不存在(javascript) - CS0103: The name ' ' does not exist in the current context (javascript)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM