jQuery Modal Dialog With dynamic Content

vbbottrying

New Member
OK, beating my head here. There seems to be lots of discussion about this, but I think I need it broken down in more detail. I would like to create a modal dialog with a tree view that allows some user interaction (check boxes), and then sets a field on the main page when the user clicks OK on the dialog. Not totally sure how to do this.I can open the dialog with a button click no problem.Markup:\[code\]<input id="buttonBuildSelect" runat="server" value="http://stackoverflow.com/questions/12787562/Build Select" type="submit" onserverclick="buttonBuildSelect_ServerClick" /><div id="dialog" title="Expression Builder"> <p> <asp:CheckBox ID="checkBoxOverwrite" runat="server" Text="Overwrite Existing Statement" /></p> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Panel ID="Panel1" runat="server" Style="border: 1px solid black; overflow: auto; height: 200px;"> <asp:Label ID="labelExpressionType" runat="server" Text=""></asp:Label> <asp:TreeView ID="popupTreeView" runat="server" CssClass="treeview" ShowLines="true" NodeStyle-CssClass="nodeStyle"> </asp:TreeView> </asp:Panel> </ContentTemplate> </asp:UpdatePanel> <br /> </div>\[/code\]Script:\[code\]$(document).ready(function () { $(function () { $("input:submit").button(); $("input:submit").click(function () { $("#dialog").dialog("open"); return false; }); }); $(function () { $("#dialog").dialog( { autoOpen: false, modal: true, width: 400, height: 355, resizable: false, open: function () { $(this).load("ExpressionBuilder.ascx"); }, options: { resizable: false }, buttons: { "OK": function () { return false }, Cancel: function () { $(this).dialog("close") } } } ) });});\[/code\]But I cannot figure out how to 1) Click Button 2) Load Tree View From Database 3) Open DialogI have been working on two methods, but can't get either to work.Method 1: Use ajax. But, what format do I return data in to bind to tree view and how to bind tree view from script.Method 2: Put contents of dialog in separate user control, and then set the dialog to load the user controlWhich method to pursue, and then need some assistance in getting that method working...Thanks
 
Back
Top