2009-09-24 48 views
0

如何将数据传递给jqModal?例如,当Button2被点击时,我可以传递按钮的ID或隐藏的字段,并让控制器捡起它?jqModal传递参数

<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> 

感谢, rodchar

回答

0
$.post("/Articles/jQueryAddComment", { commentText: commentText, id: id, type: commentType },function..... 

我打电话给我的控制器是这样,我传递的参数,就见上面。

如果您想将ID传递给控制器​​,您可以使用this.id。

这是你之后或我离开基地?

+0

感谢您的帮助, 棒 – Rod 2009-10-09 12:49:06