2014-09-28 12 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; 
    } 
    
    相關問題