Razor以HTML格式转义引号

时间:2017-12-04 18:01:27

标签: html razor

我想在我的@row.TempOrderID事件中使用onclick作为查询字符串变量,但它在我的代码中没有正确传递。可能是语法问题。

<div class="table-responsive"> 
<div class="dg-scroll-horizontal">
 <table class="table table-striped table-condensed table-bordered" style="table-layout: auto;" width="100%" border="0">
  <tbody>
    <tr>
      <th scope="col">Type</th>
      <th scope="col">Company</th>
      <th scope="col">Contact Person</th>
      <th scope="col">Phone</th>
      <th scope="col">Email</th>
    </tr>
     @foreach (var row in BSDB.TempOrderA("TempOrderID='" + TknParams.TempOrderID + "'")) {
    <tr>
      <td>@row.OrganizationType</td>
      <td>@row.CC_Company</td>
      <td>@row.CC_Contact</td>
      <td>@row.CC_Phone</td>
      <td>@row.CC_Email</td>
      <td style="text-align: center;"><a class="btn btn-info" href="/dev/Client-Info" onclick="return dnnModal.show('/dev/Client-Info?popUp=true&TempOrderID=@row.TempOrderID',true,550,550,false)"><i class="fa fa-search"></i></a></td>
    </tr>
    }
</table>
</div>
</div>

添加两组双引号""确实可以正确转义但是我的网址格式不正确IE:

<a class="btn btn-info" href="/dev/Client-Info" onclick="return dnnModal.show('/dev/Client-Info?popUp=true&amp;TempOrderID=" "2""',true,550,550,false)"=""><i class="fa fa-search"></i></a>

0 个答案:

没有答案