2014-09-28 10 views
0

的内容如何取消/禁止选择文本生成的元素的选择(文本内):由@Html.EditorFor 如何禁用/取消由@ Html.EditorFor或表

  • 或者如果没有产生

    • ,只是

    通过禁用选择文本我的意思是阻挡像使图像贝洛标记/选择/选择文本的可能性:所述web应用

  • 或如果没有,在像低于该一个表至少文本内的任何文本女:

    enter image description here

    <table class="table"> 
        <tr> 
         <th> 
          No. 
         </th> 
         <th> 
          @Html.DisplayNameFor(model => model.LastName) 
         </th> 
         <th> 
          @Html.DisplayNameFor(model => model.FirstName) 
         </th> 
         <th> 
          @Html.DisplayNameFor(model => model.CellNumber) 
         </th> 
         <th> 
          @Html.DisplayNameFor(model => model.SecondaryPhoneNumber) 
         </th> 
         <th> 
          @Html.DisplayNameFor(model => model.Address) 
         </th> 
         <th></th> 
        </tr> 
    
        @foreach (var item in Model) { 
         <tr> 
          <td> 
           @noPerson @{noPerson++;} 
          </td> 
          <td> 
           @Html.DisplayFor(modelItem => item.LastName) 
          </td> 
          <td> 
           @Html.DisplayFor(modelItem => item.FirstName) 
          </td> 
          <td> 
           @Html.DisplayFor(modelItem => item.CellNumber) 
          </td> 
          <td> 
           @Html.DisplayFor(modelItem => item.SecondaryPhoneNumber) 
          </td> 
          <td> 
           @Html.DisplayFor(modelItem => item.Address) 
          </td> 
          <td> 
           @Html.ActionLink("Details", "Details", new { id = item.Id }, new { @class = "btn btn-info btn-xs" }) | 
           @Html.ActionLink("Edit", "Edit", new { id = item.Id }, new { @class = "btn btn-warning btn-xs" }) 
           @if (Request.IsAuthenticated && User.IsInRole("Admin")) { <text> |</text> 
            @Html.ActionLink("Delete", "Delete", new { id = item.Id }, new { @class = "btn btn-danger btn-xs" }) 
           } 
          </td> 
         </tr> 
        } 
    </table> 
    
  • +0

    不知道你的意思是取消/禁用选择文本 – beautifulcoder 2014-09-28 20:30:00

    回答

    0

    从其他问题,只需添加CSS

    body{ 
        -webkit-touch-callout: none; 
        -webkit-user-select: none; 
        -khtml-user-select: none; 
        -moz-user-select: none; 
        -ms-user-select: none; 
        user-select: none; 
    } 
    
    相关问题