MVC的Razor页面参数传递(html向jquery传参)

razor页面

<script type="text/javascript">
    function ConfirmDelete(a) {
        if (confirm("Are you sure you want to delete this vehicle?"))
        {
            $.ajax({
                url: '@Url.Action("DeleteVehicle", "MPTPlanning")',
                data: { vehicleGUID: a.id }
            });
        }
    }
</script>

<script id="search-row-template" type="text/x-kendo-template">
<tr data-uid="#: blockCorpMsgID #" class="ItemGridRow">
    <td>
        <table width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <td style="white-space:nowrap;text-align:right;"><b style="font-size:10px;">#: vehicleTypeName# Number:</b></td>
                <td style="white-space:nowrap;text-align:left;">#: vehicleNum#</td>
                <td style="white-space:nowrap;padding-left:15px;text-align:right;"><b style="font-size:10px;">Advertised:&nbsp;</b></td>
                <td style="white-space:nowrap;text-align:left;">#: kendo.toString(kendo.parseDate(inHomeDate), "MM/dd/yyyy")# - #: kendo.toString(kendo.parseDate(goodThroughDate), "MM/dd/yyyy")#</td>
                <td style="white-space:nowrap;vertical-align:top;width:48px;" rowspan="5">                    
                    <a href="viewVehicle?vehicleGUID=#: vehicleGUID#"><img src="@Url.Content("~/Content/MPT/Images/ViewIcon.gif")" alt="View" style="width:16px;vertical-align:top;cursor:pointer;" /></a>                    
                    #= btnEditVehicle ? "<a href='editVehicle?vehicleGUID=" + vehicleGUID + "'><img src='@Url.Content("~/Content/MPT/Images/EditIcon.gif")' alt='Edit' style='width:14px;vertical-align:top;cursor:pointer;' /></a>" : ""#                
                    #= btnDeleteVehicle ? "<a οnclick='ConfirmDelete(this);' id='" + vehicleGUID + "'><img src='@Url.Content("~/Content/MPT/Images/DeleteIcon.gif")' alt='Delete' style='width:14px;vertical-align:top;cursor:pointer;' /></a>" : ""#
                </td>
            </tr>
</table>
    </td>
</tr>
</script>
delete按钮操作时ConfirmDelete方法的参数获取方式

转载于:https://www.cnblogs.com/haoxiwang001/p/5211941.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值