私はMVC3を初めて使用しました。値をモーダルダイアログに戻すことができるかどうかを知りたいと思います。以下の例を参照してください。MVC3のモーダルダイアログへの戻り値
私の.cshtmlファイルでは、「ログ」ボタンをクリックするとログアクションが呼び出されます。私のコントローラのアクションで
<button name="button" value="log" id="log">Log</button>
<div id="dialog-message" title="Input Error!">
<p>
<span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span>
The result from the controller is :
</p>
</div>
私はjqueryのモーダルダイアログがxの値を表示するこの
public ActionResult Log(FormCollection collection)
{
if(x+2!=4)
{
// return the value of x to the modal dialog
}
else
{
// save record to database
}
}
を持っています。 jqueryのスクリプトで
、私は助けてください
$("#dialog-message").dialog({
autoOpen: false,
modal: true,
buttons: {
Ok: function() {
$(this).dialog("close");
}
}
});
$("#log").click(function() {
$("#dialog-message").dialog("open");
this.defaultShowErrors();
});
の下を持っています!
解決策を試したところ、モーダルダイアログは空でした。しかし、xの値を含む新しいページが開きました。私が必要とするのは、ダイアログにxを表示することです。ありがとうございました –