我有下面的代码但是它给出的错误 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()" />