jqModal传递参数
如何将数据传递给 jqModal?例如,当单击 Button2 时,我可以传递按钮的 id 或隐藏字段并让控制器拾取它吗?
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">
$(document).ready(function() {
$('#title').css('background-color', 'red');
$('#dialog').jqm({ trigger: '.Button2', ajax: "/Home/AddAssignment" });
});
</script>
<h2 id="title">Index</h2>
<div id="dialog" class="jqmWindow">This is a dialog window</div>
<a class="Button2" id="Button2">Test</a>
<div id="someDiv">some div</div>
</asp:Content>
谢谢, 罗德查尔
how do you pass data to the jqModal? For example, when Button2 is clicked can i pass the button's id or a hidden field and have the controller pick it up?
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">
$(document).ready(function() {
$('#title').css('background-color', 'red');
$('#dialog').jqm({ trigger: '.Button2', ajax: "/Home/AddAssignment" });
});
</script>
<h2 id="title">Index</h2>
<div id="dialog" class="jqmWindow">This is a dialog window</div>
<a class="Button2" id="Button2">Test</a>
<div id="someDiv">some div</div>
</asp:Content>
Thanks,
rodchar
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我这样调用我的控制器,并传入如上所示的参数。
如果你想将 id 传递给控制器,你可以使用 this.id 。
这是你想要的还是我偏离了基地?
I call my controller like this and I pass in the parameters as you see above.
You could use this.id if you want to pass the id to the controller.
Is this what you were after or am I off base?