I have a div that contains 3 asp:RadioButtons and 1 asp:DropDownList. The DropDownList gets populated with fileIds from a stored procedure(SqlDataSource). The radio buttons, sorts the DropDownList depending one which one the user selects.
Here is my jQuery calling the div containing the controls:
function getCaseFiles(canCopyTo) {
debugger;
var dlg = $('#casefiles').dialog({//casefiles is the div where my controls are nested in
autoOpen: true,
height: 'auto',
width: 'auto',
modal: true,
open: function(type, data) {
$(this).parent().appendTo("form");
}
});
}
Inside my div there are 2 updatePanels. One is for the RadioButtons and the other one is for the DropDownList.
when I run the popup, the controls appear, but as soon as I click on a RadioButton(AutoPostback="true"), The code behind doesn't even get run, it just gives me this error straight away :
Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 404
Error$create
Sys$WebForms$PageRequestManager$_createPageRequestManagerServerError
Sys$WebForms$PageRequestManager$_onFormSubmitCompleted
(anonymous function)
(anonymous function)
Sys$Net$WebRequest$completed
Sys$Net$XMLHttpExecutor._onReadyStateChange
I will post all my code here. I didn't include my code at the top since I think it might scare people awayat first glance lol. Anyways, here is all my code:
While using dialog it copies the content outside form tag. Thats why while posting it does not post the values that are inside dialog. Check this post-
Thank you very much. I will definitely look into it when I get back. Although I think I may have already tried some of these solutions. I will try again
mr_biggels
0 Points
2 Posts
Trying to put DropDownList and RadioButtons into jQuery UI dialog, but AutoPostback is causing pr...
Oct 02, 2012 04:15 PM|LINK
I have a div that contains 3 asp:RadioButtons and 1 asp:DropDownList. The DropDownList gets populated with fileIds from a stored procedure(SqlDataSource). The radio buttons, sorts the DropDownList depending one which one the user selects.
Here is my jQuery calling the div containing the controls:
function getCaseFiles(canCopyTo) { debugger; var dlg = $('#casefiles').dialog({//casefiles is the div where my controls are nested in autoOpen: true, height: 'auto', width: 'auto', modal: true, open: function(type, data) { $(this).parent().appendTo("form"); } }); }<div id="casefiles"> <ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" /> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always"> <ContentTemplate> <%--<div id="rbfileByHolder" runat="server">--%> <label> Sort By</label> <span> <asp:RadioButton class="aspRBs" GroupName="rbfileByNameOrID" ID="rbMyFiles" Text="My Files" Checked="true" runat="server" AutoPostBack="True" OnCheckedChanged="rbMyFiles_CheckedChanged" /></span> <span> <asp:RadioButton class="aspRBs" GroupName="rbfileByNameOrID" ID="rbByFileID" Text="By File ID" runat="server" AutoPostBack="True" OnCheckedChanged="rbByFileID_CheckedChanged" /></span> <span> <asp:RadioButton class="aspRBs" GroupName="rbfileByNameOrID" ID="rbByFileName" Text="By File Name" runat="server" AutoPostBack="True" OnCheckedChanged="rbByFileName_CheckedChanged" /></span> <%-- </div>--%> <br /> </ContentTemplate> </asp:UpdatePanel> <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true"> <ContentTemplate> <label> Select New CaseFile</label> <asp:DropDownList runat="server" ID="ddlCaseFiles" DataSourceID="dsMyCaseFiles" DataTextField="Display" DataValueField="FileID" OnPreRender="ddl_PreRender" Width="524px" /> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlCaseFiles" ToolTip="Casefile Required" InitialValue="-1" Text="*" Display="Dynamic" /> <ajaxToolkit:ListSearchExtender ID="ddlExtCaseFiles" runat="server" PromptCssClass="ListSearchExtenderPrompt" TargetControlID="ddlCaseFiles" BehaviorID="ddlExtCaseFiles" Enabled="True" /> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="rbByFileName" EventName="CheckedChanged" /> <asp:AsyncPostBackTrigger ControlID="rbByFileID" EventName="CheckedChanged" /> <asp:AsyncPostBackTrigger ControlID="rbMyFiles" EventName="CheckedChanged" /> </Triggers> </asp:UpdatePanel> </div>protected void rbByFileName_CheckedChanged(object sender, EventArgs e) { ddlCaseFiles.DataSourceID = "dsCaseFilesReverse"; ddlCaseFiles.DataTextField = "Display"; ddlCaseFiles.DataValueField = "FileID"; //ddlCaseFiles.DataBind(); UpdatePanel1.Update(); UpdatePanel2.Update(); } protected void rbByFileID_CheckedChanged(object sender, EventArgs e) { ddlCaseFiles.DataSourceID = "dsCaseFiles"; ddlCaseFiles.DataTextField = "Display"; ddlCaseFiles.DataValueField = "FileID"; UpdatePanel1.Update(); UpdatePanel2.Update(); } protected void rbMyFiles_CheckedChanged(object sender, EventArgs e) { ddlCaseFiles.DataSourceID = "dsMyCaseFiles"; ddlCaseFiles.DataTextField = "Display"; ddlCaseFiles.DataValueField = "FileID"; UpdatePanel1.Update(); UpdatePanel2.Update(); } protected void ddl_PreRender(object sender, EventArgs e) { DropDownList ddl = (DropDownList)sender; try { if (ddl.Items[0].Value != "-1") ddl.Items.Insert(0, new ListItem("--Select--", "-1")); } catch { ddl.Items.Insert(0, new ListItem("--Select--", "-1")); } }asteranup
All-Star
30184 Points
4906 Posts
Re: Trying to put DropDownList and RadioButtons into jQuery UI dialog, but AutoPostback is causin...
Oct 03, 2012 07:47 AM|LINK
Hi,
While using dialog it copies the content outside form tag. Thats why while posting it does not post the values that are inside dialog. Check this post-
http://delicious.com/anupdg/dialog+postback
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog
mr_biggels
0 Points
2 Posts
Re: Trying to put DropDownList and RadioButtons into jQuery UI dialog, but AutoPostback is causin...
Oct 04, 2012 01:49 AM|LINK
Thank you very much. I will definitely look into it when I get back. Although I think I may have already tried some of these solutions. I will try again