小编SPQ*_*PQR的帖子

在不使用JavaScript的情况下将焦点放在EditorFor上

是否可以在不使用JavaScript的情况下将重点放在页面加载上的以下代码中?

<div class="col-md-10">
    @Html.EditorFor(model => model.Description)
    @Html.ValidationMessageFor(model => model.Description)
</div>                
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc razor asp.net-mvc-3

11
推荐指数
1
解决办法
9883
查看次数

目标数组不够长.检查destindex和length以及数组的下限

我有一个包含以下代码的类:

  Array tags;
  if (lines.Length > 0)
  {
      configText = lines[0];
      tags = new Array[lines.Length];
      lines.CopyTo(tags,1);
  }
Run Code Online (Sandbox Code Playgroud)

在这里我收到以下错误:

目标数组不够长.检查destindex和length以及数组的下限.

方法:

     private bool ReadPointListFile(string fileName) {

        // Read each line of the file into a string array. Each element
        // of the array is one line of the file.
        string[] lines = System.IO.File.ReadAllLines(fileName);
        string configText = string.Empty;

        if (lines.Length > 0)
        {
            configText = lines[0];
            tags = new Array[lines.Length];
            lines.CopyTo(tags,1);
        }
        else
            lines.CopyTo(tags,0);

        GetConfigurationInfo(lines[0], out this.sInterval, out this.dataAggregate);

        return true;
    }
Run Code Online (Sandbox Code Playgroud)

c# arrays exception

3
推荐指数
1
解决办法
8629
查看次数

标签 统计

arrays ×1

asp.net-mvc ×1

asp.net-mvc-3 ×1

c# ×1

exception ×1

razor ×1