• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 418
  • Last Modified:

Problem like in radcontrols.

There is a problem I have similar ,

http://www.codeproject.com/KB/ajax/AjaxValidationsOnPanes.aspx
See image.

error.png
0
mathieu_cupryk
Asked:
mathieu_cupryk
  • 3
2 Solutions
 
apexpertCommented:
there is casting problem try to convert it in to .ToString() format.
0
 
mathieu_cuprykAuthor Commented:
sorry that is the wrong pic.

The site I show u handles it for ajax panels. I am using rad controls and ajax callouts.
problem.png
0
 
princeatapiCommented:
May i have the code excerpt that throws error ?
0
 
mathieu_cuprykAuthor Commented:
the problem is that the usercontols are being loaded.
when the tabs are being loaded.

There is must be a way on page_load to do something.
The ajax callout is being submitted somehow.

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ctrlAboutMe.ascx.cs"
    Inherits="OmegaLove.Web.UI.ctrlAboutMe" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<div class="accordionContent" style="display: block;">
    <div class="boxContent">
        <div style="padding-left: 15px; padding-right: 15px;">
            <br />
            <div class="gray14pt">
                <table border="0" cellspacing="0" width="100%">
                    <tr>
                        <td style="width: 200px;">
                            <div style="font-family: verdana; font-weight: normal; font-size: small">
                                <img alt="" height="14" src="<%=Page.ResolveUrl("~/Images/Icons/starsmallfull.gif")%>"
                                    width="15" />&nbsp;UserName :
                            </div>
                        </td>
                        <td colspan="3">
                            &nbsp;<asp:TextBox ID="txtUserName" ReadOnly="true" MaxLength="10" runat="server"
                                BorderColor="DarkGray" CssClass="textBox" />
                            <span class="gray12pt"><span style="color: Red;">*</span>Sorry, UserName <span class="red12pt">
                                CANNOT</span> be changed.</span>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" style="border-bottom: 1px solid #CECFCE;">
                            <img src="<%=Page.ResolveUrl("~/Images/AboutMe/spacer.gif")%>" style="border-width: 0px;" />
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 200px;">
                            <div style="font-family: verdana; font-weight: normal; font-size: small">
                                <img alt="" height="14" src="<%=Page.ResolveUrl("~/Images/Icons/starsmallfull.gif")%>"
                                    width="15" />&nbsp;HeadLine:
                            </div>
                        </td>
                        <td colspan="3">
                            <asp:TextBox ID="txtHeadLine" MaxLength="128" runat="server" BorderColor="DarkGray"
                                width="300px" />      
                            <asp:RequiredFieldValidator ID="RFVtxtHeadLine" runat="server" ControlToValidate="txtHeadLine"
                                ErrorMessage="<b>Required Field Missing.</b><br />HeadLine is required." Font-Size="X-Small"
                                SetFocusOnError="true" Display="None"></asp:RequiredFieldValidator>
                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="RFVtxtHeadLineE" TargetControlID="RFVtxtHeadLine"
                                HighlightCssClass="validatorCalloutHighlight" />
                            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender14" runat="server"
                                TargetControlID="RFVtxtHeadLine">
                            </ajaxToolkit:ValidatorCalloutExtender>
                            <asp:RegularExpressionValidator ID="REVtxtHeadLine" runat="server" ControlToValidate="txtHeadLine"
                                Font-Size="X-Small" SetFocusOnError="true" ValidationExpression="^[a-zA-Z]{1}[a-zA-Z]{1,74}$"
                                ErrorMessage="<b>A valid HeadLineis required,</b><br />Please type between 2 to 128 letters<br />(avoid special characters and digits)"
                                Display="None"></asp:RegularExpressionValidator>
                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="REVtxtHeadLineE" TargetControlID="REVtxtHeadLine"
                                HighlightCssClass="validatorCalloutHighlight" />
                            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender17" runat="server"
                                TargetControlID="REVtxtHeadLine">
                            </ajaxToolkit:ValidatorCalloutExtender>
                                
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" style="border-bottom: 1px solid #CECFCE;">
                            <img src="<%=Page.ResolveUrl("~/Images/AboutMe/spacer.gif")%>" style="border-width: 0px;" />
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 200px;">
                            <div style="font-family: verdana; font-weight: normal; font-size: small">
                                <img alt="" height="14" src="<%=Page.ResolveUrl("~/Images/Icons/starsmallfull.gif")%>"
                                    width="15" />&nbsp;Sex :
                            </div>
                        </td>
                        <td colspan="3">
                            &nbsp;<asp:TextBox ID="txtSex" ReadOnly="true" MaxLength="10" runat="server" BorderColor="DarkGray"
                                CssClass="textBox" />
                            <span class="gray12pt"><span style="color: Red;">*</span>Sorry, Gender <span class="red12pt">
                                CANNOT</span> be changed.</span>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" style="border-bottom: 1px solid #CECFCE;">
                            <img src="<%=Page.ResolveUrl("~/Images/AboutMe/spacer.gif")%>" style="border-width: 0px;" />
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 200px;">
                            <div style="font-family: verdana; font-weight: normal; font-size: small">
                                <img alt="" height="14" src="<%=Page.ResolveUrl("~/Images/Icons/starsmallfull.gif")%>"
                                    width="15" />&nbsp;Zip/Postal Code :
                            </div>
                        </td>
                        <td colspan="3">
                            <asp:TextBox ID="txtZipCode" MaxLength="10" runat="server" BorderColor="DarkGray"
                                CssClass="textBox" />
                            <asp:RequiredFieldValidator ID="RFVtxtZipCode" Font-Size="X-Small" SetFocusOnError="true"
                                ControlToValidate="txtZipCode" ErrorMessage="<b>Required Field Missing.</b><br />Zip/Postal code is required."
                                runat="server" Display="None" />
                            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="RFVtxtZipCodeE" TargetControlID="RFVtxtZipCode"
                                HighlightCssClass="validatorCalloutHighlight" />
                            <ajaxToolkit:ValidatorCalloutExtender ID="ValidatorCalloutExtender15" runat="server"
                                TargetControlID="REVtxtZipCode" />
                            <asp:RegularExpressionValidator ID="REVtxtZipCode" ControlToValidate="txtZipCode"
                                Font-Size="X-Small" SetFocusOnError="true" ErrorMessage="<b>This appears to be not a valid zip/postal code.</b><br />Please enter in your zip/postal code in the correct format:"
                                ValidationExpression="^[a-zA-Z]{1}[0-9]{1}[a-zA-Z]{1}(\-| |){1}[0-9]{1}[a-zA-Z]{1}[0-9]{1}$"
                                runat="server" Display="None" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" style="border-bottom: 1px solid #CECFCE;">
                            <img src="<%=Page.ResolveUrl("~/Images/AboutMe/spacer.gif")%>" style="border-width: 0px;" />
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 200px;">
                            <div style="font-family: verdana; font-weight: normal; font-size: small">
                                <img alt="" height="14" src="<%=Page.ResolveUrl("~/Images/Icons/starsmallfull.gif")%>"
                                    width="15" />&nbsp;Country :
                            </div>
                        </td>
                        <td colspan="3">
                            <asp:DropDownList Style="position: static" Width="180px" ID="ddlCountryRegister"
                                Font-Names="Verdana" Font-Size="Small" runat="server" ForeColor="Black">
                            </asp:DropDownList>
                            <ajaxToolkit:CascadingDropDown ID="cddCountryRegister" runat="server" TargetControlID="ddlCountryRegister"
                                BehaviorID="myCDECountryRegister" Category="Country" PromptText="Choose a Country"
                                LoadingText="[Loading Countries...]" ServicePath="~/LocationWebService.asmx"
                                ServiceMethod="GetCountries" Enabled="True" />
                            <asp:Image ID="imgFlagRegister" runat="server" Height="12px" Width="23px" ImageAlign="AbsMiddle" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" style="border-bottom: 1px solid #CECFCE;">
                            <img src="<%=Page.ResolveUrl("~/Images/AboutMe/spacer.gif")%>" style="border-width: 0px;" />
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 200px;">
                            <div style="font-family: verdana; font-weight: normal; font-size: small">
                                <img alt="" height="14" src="<%=Page.ResolveUrl("~/Images/Icons/starsmallfull.gif")%>"
                                    width="15" />&nbsp;State/Province :
                            </div>
                        </td>
                        <td colspan="3">
                            <asp:DropDownList Style="position: static" Width="180px" ID="ddlRegion" runat="server"
                                Font-Names="Verdana" Font-Size="Small" ForeColor="Black">
                            </asp:DropDownList>
                            <ajaxToolkit:CascadingDropDown ID="cddRegion" runat="server" TargetControlID="ddlRegion"
                                ParentControlID="ddlCountryRegister" Category="Region" LoadingText="Loading Provinces/States..."
                                ServicePath="~/LocationWebService.asmx" ServiceMethod="GetRegionsForCountry" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" style="border-bottom: 1px solid #CECFCE;">
                            <img src="<%=Page.ResolveUrl("~/Images/AboutMe/spacer.gif")%>" style="border-width: 0px;" />
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 200px;">
                            <div style="font-family: verdana; font-weight: normal; font-size: small">
                                <img alt="" height="14" src="<%=Page.ResolveUrl("~/Images/Icons/starsmallfull.gif")%>"
                                    width="15" />&nbsp;City :
                            </div>
                        </td>
                        <td colspan="3">
                            <asp:DropDownList Style="position: static" Width="180px" ID="ddlCity" runat="server"
                                Font-Names="Verdana" Font-Size="Small" ForeColor="Black">
                            </asp:DropDownList>
                            <ajaxToolkit:CascadingDropDown ID="cddCity" runat="server" TargetControlID="ddlCity"
                                ParentControlID="ddlRegion" Category="City" LoadingText="Loading Cities..." ServicePath="~/LocationWebService.asmx"
                                ServiceMethod="GetCityForRegionCountry" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" style="border-bottom: 1px solid #CECFCE;">
                            <img src="<%=Page.ResolveUrl("~/Images/AboutMe/spacer.gif")%>" style="border-width: 0px;" />
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 200px;">
                            <div style="font-family: verdana; font-weight: normal; font-size: small">
                                <img alt="" height="14" src="<%=Page.ResolveUrl("~/Images/Icons/starsmallfull.gif")%>"
                                    width="15" />&nbsp;Sexual Orientation:
                            </div>
                        </td>
                        <td colspan="3">
                            <asp:DropDownList Style="position: static" ForeColor="Black" Font-Names="Verdana"
                                Font-Size="Small" ID="ddlSexualOrientation" runat="server">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" style="border-bottom: 1px solid #CECFCE;">
                            <img src="<%=Page.ResolveUrl("~/Images/AboutMe/spacer.gif")%>" style="border-width: 0px;" />
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 200px;">
                            <div style="font-family: verdana; font-weight: normal; font-size: small">
                                <img alt="" height="14" src="<%=Page.ResolveUrl("~/Images/Icons/starsmallfull.gif")%>"
                                    width="15" />&nbsp;Mother Tongue:
                            </div>
                        </td>
                        <td colspan="3">
                            <asp:DropDownList Style="position: static" ForeColor="Black" Font-Names="Verdana"
                                Font-Size="Small" ID="ddlMotherTongue" runat="server" OnSelectedIndexChanged="ddlMotherTongue_SelectedIndexChanged">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" style="border-bottom: 1px solid #CECFCE;">
                            <img src="<%=Page.ResolveUrl("~/Images/AboutMe/spacer.gif")%>" style="border-width: 0px;" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</div>

<script language="javascript" type="text/javascript">

    Sys.Application.add_load(page_load);
    Sys.Application.add_unload(page_unload);

    function page_load(sender, e) 
    {
        $find("myCDECountryRegister").add_selectionChanged(Register_SelectedIndexChangedCountry);
    }

    function page_unload(sender, e) 
    {
    }


    function Register_SelectedIndexChangedCountry() 
    {
        //change the images based on the selected value.
        var countryDropdown = $get('<%=ddlCountryRegister.ClientID%>');
        $get("<%=imgFlagRegister.ClientID%>").src = "../Images/flags/" + countryDropdown.value + ".gif";
    }

    function getDropDownListvalue() 
    {
        var IndexValue = $get('<%=ddlRegion.ClientID%>').selectedIndex;
        var SelectedVal = $get('<%=ddlRegion.ClientID%>').options[IndexValue].value;
        alert(SelectedVal);
    }   
</script>

Open in new window

0
 
mathieu_cuprykAuthor Commented:
The problem is that there the field should be populated when load teh panels.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now