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: </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 onclick='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方法的参数获取方式
posted on 2016-02-24 10:03 haoxiwang001 阅读(630) 评论(0) 编辑 收藏 举报