2009-09-24 104 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