我有下面的代码 但它在当前上下文中不存在给出错误param1
$('#dialog').dialog({
autoOpen: true,
width: 400,
resizable: false,
title: 'My Table',
modal: true,
open: function (event, ui) {
var param1 = $('#txtfirst').val();
var param2 = $('#txtlast').val();
url = "@(Html.Raw(Url.Action("Index1", new { first = param1, last = param2 })))";
alert(url);
$(this).load(url);
///////////////////////////
<div id="dialog"></div>
<input id="txtfirst" type="text"/>
<input id="txtlast" type="text"/>
<input type="button" value="Get Form" onclick="getForm()" />