Access variables inside JQuery dialog
问题 I have a user ID in viewBag I want to access the ViewBag inside my dialog box <script> $(function () { $("#dialog").dialog({ autoOpen: false, modal: true, width: 339, overlay: { backgroundColor: 'red', opacity: 0.5 }, show: { effect: "blind", duration: 500 }, hide: { effect: "explode", duration: 700 } }); }); function OpenDialog() { $('#dialog').dialog("open"); } </script> <div id="open" onclick="OpenDialog();">Click To Open</div> @ViewBag.UserID <div id="dialog"> <table> <tr> <td>User ID</td