Sunday, March 11, 2012

CascadingDropDown causes invalid postback or callback argument error

Hi,Salvatore

I am afraid we cannot find out the exact root cause without further information captured when the problem occurs.

To troubleshoot this issue, we really need more source code to reproduce the problem, so that we can investigate the issue in house. It is not necessary that you send out the complete source of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business logic from it.

Thank you.


Look at my code :D
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="ContentPlaceHolder2"> <div id="divCreateNewUser" style="left: 150px; position: relative; top: 30px"> <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" BackColor="#F7F7DE" BorderColor="#CCCC99" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="10pt" LoginCreatedUser="False" OnCreatingUser="CreatingUser" OnCreatedUser="CreatedUser"> <WizardSteps> <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server"> <ContentTemplate> <table border="0" style="font-size: 100%; width: 400px; font-family: Verdana"> <tr> <td align="center" colspan="2" style="font-weight: bold; color: white; background-color: #6b696b"> Sign Up for Your New Account</td> </tr> <tr> <td align="right"> <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label></td> <td> <asp:TextBox ID="UserName" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label></td> <td> <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox> <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label></td> <td> <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox> <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword" ErrorMessage="Confirm Password is required." ToolTip="Confirm Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label></td> <td> <asp:TextBox ID="Email" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email" ErrorMessage="E-mail is required." ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> <asp:Label ID="lblConfirmEmail" runat="server" AssociatedControlID="txtEmailConfirm">Confirm E-mail:</asp:Label></td> <td> <asp:TextBox ID="txtEmailConfirm" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="EmailConfirmRequired" runat="server" ControlToValidate="txtEmailConfirm" ErrorMessage="Confirm E-mail is required." ToolTip="Confirm E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right" colspan="2" rowspan="2"> <div id="divDropDownCountry" style="vertical-align: top; width: 400px; text-align: center"> <table> <tr> <td> <asp:Label ID="lblCountry" runat="server">Country:</asp:Label></td> <td> <%-- ID="CountryDDL" runat="server" Text="Italy"/>--%> <asp:DropDownList ID="CountryDDL" runat="server" Width="170" /> <asp:RequiredFieldValidator ID="CountryRequired" runat="server" ControlToValidate="CountryDDL" ErrorMessage="Country is required." ToolTip="Country is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td> <asp:Label ID="lblCity" runat="server">City:</asp:Label></td> <td> <%--"CityDDL" runat="server" Text="Milan"/>--%> <asp:DropDownList ID="CityDDL" runat="server" Width="170" /> <asp:RequiredFieldValidator ID="CityRequired" runat="server" ControlToValidate="CityDDL" ErrorMessage="City is required." ToolTip="City is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> </table> <cc1:CascadingDropDown ID="CascadingDropDown1" runat="server" TargetControlID="CountryDDL" Category="Country" PromptText="Please select a country" LoadingText="[Loading countries...]" ServicePath="CountryService.asmx" ServiceMethod="GetDropDownContents" /> <cc1:CascadingDropDown ID="CascadingDropDown2" runat="server" TargetControlID="CityDDL" Category="City" PromptText="Please select a city" LoadingText="[Loading cities...]" ServicePath="CountryService.asmx" ServiceMethod="GetDropDownContents" ParentControlID="CountryDDL" /> </div> </td> </tr> <tr> </tr> <tr> <td align="right"> <asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">Security Question:</asp:Label></td> <td> <asp:TextBox ID="Question" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question" ErrorMessage="Security question is required." ToolTip="Security question is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="right"> <asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Security Answer:</asp:Label></td> <td> <asp:TextBox ID="Answer" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer" ErrorMessage="Security answer is required." ToolTip="Security answer is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td align="center" colspan="2"> <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password" ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match." ValidationGroup="CreateUserWizard1"></asp:CompareValidator> </td> </tr> <tr> <td align="center" colspan="2"> <asp:CompareValidator ID="EMailCompare" runat="server" ControlToCompare="Email" ControlToValidate="txtEmailConfirm" Display="Dynamic" ErrorMessage="The E-Mail and Confirmation E-Mail must match." ValidationGroup="CreateUserWizard1"></asp:CompareValidator></td> </tr> <tr> <td align="center" colspan="2"> <asp:Label ID="lblOutput" runat="server" ForeColor="Red" Text="Output" Visible="False"></asp:Label></td> </tr> <tr> <td align="center" colspan="2" style="color: red"> <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal> </td> </tr> </table> </ContentTemplate> </asp:CreateUserWizardStep> <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server"> <ContentTemplate> <table border="0" style="font-size: 100%; font-family: Verdana"> <tr> <td align="center" colspan="2" style="font-weight: bold; color: white; background-color: #6b696b"> Complete</td> </tr> <tr> <td> Your account has been successfully created.<br /> Check your mail to activate your account.</td> </tr> <tr> <td align="right" colspan="2"> <asp:Button ID="btnFinish" runat="server" BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" CausesValidation="False" CommandName="Finish" Font-Names="Verdana" ForeColor="#284775" Text="Finish" ValidationGroup="CreateUserWizard1" PostBackUrl="~/Default.aspx" /> </td> </tr> </table> </ContentTemplate> </asp:CompleteWizardStep> </WizardSteps> <SideBarStyle BackColor="#7C6F57" BorderWidth="0px" Font-Size="0.9em" VerticalAlign="Top" /> <TitleTextStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" /> <SideBarButtonStyle BorderWidth="0px" Font-Names="Verdana" ForeColor="White" /> <NavigationButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" /> <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" HorizontalAlign="Center" /> <CreateUserButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" /> <ContinueButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" /> <StepStyle BorderWidth="0px" /> </asp:CreateUserWizard> </div></asp:Content>

No comments:

Post a Comment