This is a migrated thread and some comments may be shown as answers.

Ajax Problem

15 Answers 118 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Web Services
Top achievements
Rank 2
Web Services asked on 20 Aug 2009, 03:43 PM
I have a page that I am trying to update a form with information populated from a combobox selection. Basically, the user selects the name from the dropdown, and then I want the rest of the fields to be updated with some data. The problem is, as soon as I add the onclientselectedindexchanged="someFunction" the combobox stops working i.e. you can't click on it to drop down. Here is my code. Please note my radscripmanager is in the master page of this file. If I need to post my master page I can. What am I doing wrong? Thanks

<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/admin/Admin.Master"
    CodeBehind="EditEntity.aspx.vb" Inherits="ClickableCommunity.EditEntity" %>

<%@ Register Assembly="RadMenu" Namespace="Telerik.WebControls" TagPrefix="radM" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <telerik:RadScriptBlock ID="ScriptBlock1" runat="server">

        <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAANvmC5YwARPSDAHoiTGyjXRR-496V5WiR7LkdzcFVQzFkDe07hhSkvWarTS8udi3TGEWMPQwT-FAGew"
            type="text/javascript"></script>

        <script type="text/javascript">

            function getLatLon(sender, args) {

                var street = $find('<%= streetInput.ClientID %>').get_value();
                var city = $find('<%= cityInput.ClientID %>').get_value();
                var state = $find('<%= stateInput.ClientID %>').get_value();
                var zip = $find('<%= zipInput.ClientID %>').get_value();
                var address = (street + ", " + city + " " + zip);

                geocodeAddress(address);
            } //getLatLon

            //this function takes in an address and returns
            //the lattitude and longitude.
            function geocodeAddress(address) {
                var coder = new GClientGeocoder();
                coder.getLatLng(address,
                              function(point) {
                                  //the id of the tool tip
                                  var toolTip = $find("<%= cantFindLocation.ClientID %>");
                                  if (!point) {

                                      //show the tool tip if it is hidden
                                      if (!toolTip.isVisible()) {
                                          toolTip.show();
                                      } //if
                                      //the tool tip is showing and the clicked the link
                                      else {
                                          toolTip.set_text("Still no dice, <a href=\"#\" onclick=\"getLatLon()\">" +
                                                           "try again</a> or get them <a href=\"" +
                                                           "http://itouchmap.com/latlong.html\" target=\"_blank\"" +
                                                           ">manually</a>.");
                                      } //else
                                  } //if
                                  //we set the textboxes to their values
                                  else {
                                      var templat = $find('<%= latInput.ClientID %>');
                                      var templon = $find('<%= lonInput.ClientID %>');
                                      templat.set_value(point.lat());
                                      templon.set_value(point.lng());

                                      //hide the tooltip if its showing
                                      if (toolTip.isVisible()) {
                                          toolTip.hide();
                                      }

                                  } //else
                              } //function(point)
                            );
            } //geocodeAddress


            
        </script>

    </telerik:RadScriptBlock>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="header" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px"
        Width="300px" EnableHistory="True" HorizontalAlign="NotSet">
    
    <table width="350px">
        <tr>
            <td>
                <center>
                    <span class="adminTableLabel">Select Entity</span>
                    <telerik:RadComboBox ID="businessNameDrop" runat="server" Skin="Web20"
                        Width="150px" MarkFirstMatch="True"
                        DropDownWidth="150px" CssClass="stateDropDownText" Font-Size="16px"
                        DataSourceID="businessDataSource" DataTextField="name"
                        DataValueField="businessid" AutoPostBack="true"
                        OnClientSelectedIndexChanged="RadComboBox1_TextChanged">
                        <CollapseAnimation Duration="1000" Type="InOutBack" />
                    </telerik:RadComboBox>
                    <asp:SqlDataSource ID="businessDataSource" runat="server"
                        ConnectionString="<%$ ConnectionStrings:connectionString %>"
                        SelectCommand="getAllBusinesses" SelectCommandType="StoredProcedure">
                    </asp:SqlDataSource>
                </center>
            </td>
            <td class="addBusinessSpacing">
            </td>
            <td></td>
        </tr>
        <tr>
            <td>
                <center>
                    <span class="adminTableLabel">Entity Name</span>
                    <telerik:RadTextBox ID="entityNameInput" runat="server" Skin="Web20" Width="150px">
                    </telerik:RadTextBox>
                    <asp:RequiredFieldValidator ID="valTxtName" ControlToValidate="entityNameInput" ErrorMessage="Please enter a Business Name."
                        CssClass="errorMessage" runat="server" />
                </center>
            </td>
            <td class="addBusinessSpacing">
            </td>
            <td></td>
        </tr>
        <tr>
            <td>
                <center>
                    <span class="adminTableLabel">Street Address</span>
                    <telerik:RadTextBox ID="streetInput" runat="server" Skin="Web20" Width="150px">
                    </telerik:RadTextBox>
                    <asp:RequiredFieldValidator ID="addressValidator" ControlToValidate="streetInput"
                        ErrorMessage="Please enter an address." CssClass="errorMessage" runat="server" />
                </center>
            </td>
            <td class="addBusinessSpacing">
            </td>
            <td>
                <center>
                    <span class="adminTableLabel">City</span>
                    <telerik:RadTextBox ID="cityInput" runat="server" Skin="Web20" Width="150px">
                    </telerik:RadTextBox>
                    <asp:RequiredFieldValidator ID="cityValidator" ControlToValidate="cityInput" ErrorMessage="Please enter a City."
                        CssClass="errorMessage" runat="server" />
                </center>
            </td>
        </tr>
        <tr>
            <td>
                <center>
                    <span class="adminTableLabel">State</span>
                    <telerik:RadComboBox ID="stateInput" runat="server" Skin="Web20" Width="150px" ChangeTextOnKeyBoardNavigation="true"
                        MarkFirstMatch="true" DropDownWidth="150px" CssClass="stateDropDownText" Font-Size="16px">
                        <CollapseAnimation Duration="1000" Type="InOutBack" />
                        <Items>
                            <telerik:RadComboBoxItem Text="Alabama" Value="AL" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Alaska" Value="AK" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Arizona" Value="AZ" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Arkansas" Value="AR" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="California" Value="CA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Colorado" Value="CO" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Connecticut" Value="CT" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Delaware" Value="DE" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="District Of Columbia" Value="DC" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Florida" Value="FL" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Georgia" Value="GA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Hawaii" Value="HI" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Idaho" Value="ID" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Illinois" Value="IL" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Indiana" Value="IN" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Iowa" Value="IA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Kansas" Value="KS" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Kentucky" Value="KY" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Louisiana" Value="LA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Maine" Value="ME" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Maryland" Value="MD" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Massachusetts" Value="MA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Michigan" Value="MI" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Minnesota" Value="MN" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Mississippi" Value="MS" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Missouri" Value="MO" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Montana" Value="MT" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Nebraska" Value="NE" CssClass="stateDropDownText"
                                Selected="true" />
                            <telerik:RadComboBoxItem Text="Nevada" Value="NV" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="New Hampshire" Value="NH" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="New Jersey" Value="NJ" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="New Mexico" Value="NM" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="New York" Value="NY" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="North Carolina" Value="NC" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="North Dakota" Value="ND" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Ohio" Value="OH" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Oklahoma" Value="OK" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Oregon" Value="OR" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Pennsylvania" Value="PA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Rhode Island" Value="RI" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="South Carolina" Value="SC" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="South Dakota" Value="SD" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Tennessee" Value="TN" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Texas" Value="TX" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Utah" Value="UT" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Vermont" Value="VT" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Virginia" Value="VA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Washington" Value="WA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="West Virginia" Value="WV" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Wisconsin" Value="WI" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Wyoming" Value="WY" CssClass="stateDropDownText" />
                        </Items>
                    </telerik:RadComboBox>
                    <span class="errorMessage" style="visibility: hidden;">spacer text</span>
                </center>
            </td>
            <td class="addBusinessSpacing">
            </td>
            <td>
                <center>
                    <span class="adminTableLabel">Zip</span>
                    <telerik:RadTextBox ID="zipInput" runat="server" Skin="Web20" Width="150px">
                        <ClientEvents OnFocus="getLatLon" />
                    </telerik:RadTextBox>
                    <asp:RegularExpressionValidator ID="reZipCode" ControlToValidate="zipInput" ValidationExpression="^\d{5}$|^\d{5}-\d{4}$"
                        ErrorMessage="Not a valid Zip code!" Display="static" runat="server" CssClass="errorMessage" />
                    <telerik:RadToolTip runat="server" ID="cantFindLocation" Skin="Web20" Height="100px"
                        Width="400px" ManualClose="true" Position="TopRight" RelativeTo="Element" TargetControlID="streetInput">
                        <span class="normalText">I can't find the address you specified. Please make sure that
                            it is typed in correctly. If you would like to manually find the latitude and longitude,
                            go to <a href="http://itouchmap.com/latlong.html" target="_blank">here</a> and get
                            the coordinates. <a href="#" onclick="getLatLon()">Look Again</a> </span>
                    </telerik:RadToolTip>
                </center>
            </td>
        </tr>
        <tr>
            <td>
                <center>
                    <span class="adminTableLabel">Latitude</span>
                    <telerik:RadTextBox ID="latInput" runat="server" Skin="Web20" Width="150px">
                    </telerik:RadTextBox>
                    <asp:RequiredFieldValidator ID="latValidator" ControlToValidate="latInput" ErrorMessage="Please enter a Latitude"
                        CssClass="errorMessage" runat="server" />
                </center>
            </td>
            <td class="addBusinessSpacing">
            </td>
            <td>
                <center>
                    <span class="adminTableLabel">Longitude</span>
                    <telerik:RadTextBox ID="lonInput" runat="server" Skin="Web20" Width="150px">
                    </telerik:RadTextBox>
                    <asp:RequiredFieldValidator ID="lonValidator" ControlToValidate="lonInput" ErrorMessage="Please enter a Business Name"
                        CssClass="errorMessage" runat="server" />
                </center>
            </td>
            <td>
                <a href="#" onclick="getLatLon()">
                    <asp:Image ID="refresh" runat="server" ImageUrl="~/images/refresh.png" Height="20px"
                        Width="20px" AlternateText="Check coordinates again." />
                </a>
            </td>
        </tr>
    </table>
    <table width="350px">
        <tr>
            <td>
                <center>
                    <asp:Button ID="addEntity" runat="server" Text="Add Entity" /><br />
                    <asp:Label ID="output" runat="server" Text=""></asp:Label>
                    <asp:SqlDataSource ID="usersDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:connectionString %>"
                        SelectCommand="returnAllNonAdminUsers" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
                </center>
            </td>
        </tr>
    </table>
    </telerik:RadAjaxPanel>
    <telerik:RadAjaxManager runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="businessNameDrop">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="entityNameInput" />
                    <telerik:AjaxUpdatedControl ControlID="streetInput" />
                    <telerik:AjaxUpdatedControl ControlID="cityInput" />
                    <telerik:AjaxUpdatedControl ControlID="stateInput" />
                    <telerik:AjaxUpdatedControl ControlID="zipInput" />
                    <telerik:AjaxUpdatedControl ControlID="latInput" />
                    <telerik:AjaxUpdatedControl ControlID="lonInput" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
</asp:Content>

This is in my vb code behind right now
    Protected Sub RadComboBox1_TextChanged(ByVal sender As Object, ByVal e As EventArgs)
        entityNameInput.Text = businessNameDrop.Text
    End Sub

15 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 21 Aug 2009, 11:28 AM
Hi,

OnClientSelectedIndexChanged defines a client-side javascript method to handle the client-side event of RadComboBox. You are trying to wire it to a server-side event. Use SelectedIndexChanged instead, with AutoPostback="true".

Best wishes,
Veli
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Web Services
Top achievements
Rank 2
answered on 21 Aug 2009, 04:31 PM
So I tried what you posted and the postback works but nothing in my function happens. Any idea why? Here is my vb

    Protected Sub businessNameDrop_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles businessNameDrop.SelectedIndexChanged
        Response.Write("test")
    End Sub

And here is the relevant aspx
<telerik:RadComboBox ID="businessNameDrop" runat="server" Skin="Web20"
                        Width="150px" MarkFirstMatch="True"
                        DropDownWidth="150px" CssClass="stateDropDownText" Font-Size="16px"
                        DataSourceID="businessDataSource" DataTextField="name"
                        DataValueField="businessid" AutoPostBack="true"
                        OnSelectedIndexChanged="businessNameDrop_SelectedIndexChanged">
                        <CollapseAnimation Duration="1000" Type="InOutBack" />
                    </telerik:RadComboBox>
Thanks,


0
Veli
Telerik team
answered on 24 Aug 2009, 04:12 PM
Hello,

I tested the setup and it works OK. The only thing I can encounter is that you are setting both:

OnSelectedIndexChanged="businessNameDrop_SelectedIndexChanged"

and

Protected Sub businessNameDrop_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles businessNameDrop.SelectedIndexChanged
        Response.Write("test")
    End Sub


In VB.NET, this will cause your method to be called twice. You need to remove one of the two definitions.

Sincerely yours,
Veli
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Web Services
Top achievements
Rank 2
answered on 24 Aug 2009, 04:50 PM
I am still having problems getting it to work. I have tried both using the OnSelectedIndexChanged="someFunction" with
Private Sub businessNameDrop_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs)
        output.Text = "test"
    End Sub
 and I have tried removing the onselectedindexchanged and using this function

Private Sub businessNameDrop_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles businessNameDrop.SelectedIndexChanged
        output.Text = "test"
    End Sub
And neither one works. Could it because I am using a masterpage? Should I start a ticket?


0
Veli
Telerik team
answered on 25 Aug 2009, 07:26 AM
Hello,

If you can paste some code we can include in a project and run, we can continue communicating in this forum thread. If you feel you need to upload a whole runnable project, it is best advisable to start a support ticket, where you can attached a zip archive of the sample project.

Sincerely yours,
Veli
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Web Services
Top achievements
Rank 2
answered on 25 Aug 2009, 03:38 PM
Ok Well I am posting quite a bit then. This page is in a master page and so I don't really know if that has something to do with it. Anyways here is the masterpage called admin.master
<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="Admin.master.vb" Inherits="ClickableCommunity.Admin" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register TagPrefix="loginDivTemplate" TagName="login" src="/ascx/loginTemplate.ascx"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
    <link href="../ClickableCommunity.css" rel="stylesheet" type="text/css" />
</head>
<body style="margin: 0px; height: 100%; overflow: hidden;"
    scroll="no" runat="server">
     <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <br />
    <asp:ContentPlaceHolder ID="header" runat="server">
    </asp:ContentPlaceHolder>
    <div id="loginDiv">
        <loginDivTemplate:login id="loginPanelContent" runat="server"></loginDivTemplate:login>
    </div>
    <div id="topDiv">
        <div id="image" class="topDivImage">
            <a href="../default.aspx" style="border:none;">
                <img style="border:none;" src="../images/logo.jpg" runat="server"
                alt="Clickable Community Logo" width="200" height="75" />
            </a>
        </div>
        <div id="viewMenu" class="viewMenu">
            Menu goes here
        </div>
    </div>
    <telerik:RadSplitter ID="RadSplitter1" runat="server" Orientation="Vertical" Width="100%"
        Height="100%" CssClass="AllContent">
        <telerik:RadPane ID="LeftRadPane1" runat="server" Width="220px" Scrolling="Both"
            BorderStyle="None" BorderSize="0">
            <div id="leftPanel">
                <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="Web20" ExpandMode="SingleExpandedItem"
                AllowCollapseAllItems="false" Width="220px" >
                    <Items>
                        <telerik:RadPanelItem runat="server" Text="Events" ChildGroupCssClass="leftPanelContent">
                            <Items>
                                <telerik:RadPanelItem runat="server" Text="Add Event" NavigateUrl="Events/AddEvent.aspx">
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem runat="server" Text="Remove Event" NavigateUrl="Events/DeleteEvent.aspx">
                                </telerik:RadPanelItem>
                            </Items>
                        </telerik:RadPanelItem>
                    </Items>
                </telerik:RadPanelBar>
            </div>
        </telerik:RadPane>
        <telerik:RadSplitBar runat="server" ID="RadSplitBar2" CollapseMode="Forward" EnableResize="false"
            ForeColor='Green' />
        <telerik:RadPane ID="RightRadPane1" runat="server" CssClass="RightPanelPadding" Scrolling="Both"
            BorderStyle="None" BorderSize="0">
            <asp:ContentPlaceHolder ID="MainContent" runat="server">
            </asp:ContentPlaceHolder>
        </telerik:RadPane>
    </telerik:RadSplitter>
    </form>
</body>
</html>

And here is the child page
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/admin/Admin.Master"
    CodeBehind="EditEntity.aspx.vb" Inherits="ClickableCommunity.EditEntity" %>

<%@ Register Assembly="RadMenu" Namespace="Telerik.WebControls" TagPrefix="radM" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <telerik:RadScriptBlock ID="ScriptBlock1" runat="server">

        <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAANvmC5YwARPSDAHoiTGyjXRR-496V5WiR7LkdzcFVQzFkDe07hhSkvWarTS8udi3TGEWMPQwT-FAGew"
            type="text/javascript"></script>

        <script type="text/javascript">

            function getLatLon(sender, args) {

                var street = $find('<%= streetInput.ClientID %>').get_value();
                var city = $find('<%= cityInput.ClientID %>').get_value();
                var state = $find('<%= stateInput.ClientID %>').get_value();
                var zip = $find('<%= zipInput.ClientID %>').get_value();
                var address = (street + ", " + city + " " + zip);

                geocodeAddress(address);
            } //getLatLon

            //this function takes in an address and returns
            //the lattitude and longitude.
            function geocodeAddress(address) {
                var coder = new GClientGeocoder();
                coder.getLatLng(address,
                              function(point) {
                                  //the id of the tool tip
                                  var toolTip = $find("<%= cantFindLocation.ClientID %>");
                                  if (!point) {

                                      //show the tool tip if it is hidden
                                      if (!toolTip.isVisible()) {
                                          toolTip.show();
                                      } //if
                                      //the tool tip is showing and the clicked the link
                                      else {
                                          toolTip.set_text("Still no dice, <a href=\"#\" onclick=\"getLatLon()\">" +
                                                           "try again</a> or get them <a href=\"" +
                                                           "http://itouchmap.com/latlong.html\" target=\"_blank\"" +
                                                           ">manually</a>.");
                                      } //else
                                  } //if
                                  //we set the textboxes to their values
                                  else {
                                      var templat = $find('<%= latInput.ClientID %>');
                                      var templon = $find('<%= lonInput.ClientID %>');
                                      templat.set_value(point.lat());
                                      templon.set_value(point.lng());

                                      //hide the tooltip if its showing
                                      if (toolTip.isVisible()) {
                                          toolTip.hide();
                                      }

                                  } //else
                              } //function(point)
                            );
            } //geocodeAddress


            
        </script>

    </telerik:RadScriptBlock>
    <style type="text/css">
    .radfdSkinnedFormButton radfd_Web20{
        text-align:center !important;
    }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="header" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px"
        Width="300px" HorizontalAlign="NotSet">
    <table width="350px">
        <tr>
            <td>
                <center>
                    <span class="adminTableLabel">Select Entity</span>
                    <telerik:RadComboBox ID="businessNameDrop" runat="server" Skin="Web20"
                        Width="150px" MarkFirstMatch="True"
                        DropDownWidth="150px" CssClass="stateDropDownText" Font-Size="16px"
                        DataSourceID="businessDataSource" DataTextField="name"
                        DataValueField="businessid" AutoPostBack="true">
                        <CollapseAnimation Duration="1000" Type="InOutBack" />
                    </telerik:RadComboBox>
                    <asp:SqlDataSource ID="businessDataSource" runat="server"
                        ConnectionString="<%$ ConnectionStrings:connectionString %>"
                        SelectCommand="getAllBusinesses" SelectCommandType="StoredProcedure">
                    </asp:SqlDataSource>
                </center>
            </td>
            <td class="addBusinessSpacing">
            </td>
            <td></td>
        </tr>
        <tr>
            <td>
                <center>
                    <span class="adminTableLabel">Entity Name</span>
                    <telerik:RadTextBox ID="entityNameInput" runat="server" Skin="Web20" Width="150px">
                    </telerik:RadTextBox>
                    <asp:RequiredFieldValidator ID="valTxtName" ControlToValidate="entityNameInput" ErrorMessage="Please enter a Business Name."
                        CssClass="errorMessage" runat="server" />
                </center>
            </td>
            <td class="addBusinessSpacing">
            </td>
            <td></td>
        </tr>
        <tr>
            <td>
                <center>
                    <span class="adminTableLabel">Street Address</span>
                    <telerik:RadTextBox ID="streetInput" runat="server" Skin="Web20" Width="150px">
                    </telerik:RadTextBox>
                    <asp:RequiredFieldValidator ID="addressValidator" ControlToValidate="streetInput"
                        ErrorMessage="Please enter an address." CssClass="errorMessage" runat="server" />
                </center>
            </td>
            <td class="addBusinessSpacing">
            </td>
            <td>
                <center>
                    <span class="adminTableLabel">City</span>
                    <telerik:RadTextBox ID="cityInput" runat="server" Skin="Web20" Width="150px">
                    </telerik:RadTextBox>
                    <asp:RequiredFieldValidator ID="cityValidator" ControlToValidate="cityInput" ErrorMessage="Please enter a City."
                        CssClass="errorMessage" runat="server" />
                </center>
            </td>
        </tr>
        <tr>
            <td>
                <center>
                    <span class="adminTableLabel">State</span>
                    <telerik:RadComboBox ID="stateInput" runat="server" Skin="Web20" Width="150px" ChangeTextOnKeyBoardNavigation="true"
                        MarkFirstMatch="true" DropDownWidth="150px" CssClass="stateDropDownText" Font-Size="16px">
                        <CollapseAnimation Duration="1000" Type="InOutBack" />
                        <Items>
                            <telerik:RadComboBoxItem Text="Alabama" Value="AL" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Alaska" Value="AK" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Arizona" Value="AZ" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Arkansas" Value="AR" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="California" Value="CA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Colorado" Value="CO" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Connecticut" Value="CT" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Delaware" Value="DE" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="District Of Columbia" Value="DC" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Florida" Value="FL" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Georgia" Value="GA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Hawaii" Value="HI" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Idaho" Value="ID" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Illinois" Value="IL" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Indiana" Value="IN" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Iowa" Value="IA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Kansas" Value="KS" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Kentucky" Value="KY" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Louisiana" Value="LA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Maine" Value="ME" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Maryland" Value="MD" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Massachusetts" Value="MA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Michigan" Value="MI" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Minnesota" Value="MN" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Mississippi" Value="MS" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Missouri" Value="MO" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Montana" Value="MT" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Nebraska" Value="NE" CssClass="stateDropDownText"
                                Selected="true" />
                            <telerik:RadComboBoxItem Text="Nevada" Value="NV" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="New Hampshire" Value="NH" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="New Jersey" Value="NJ" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="New Mexico" Value="NM" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="New York" Value="NY" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="North Carolina" Value="NC" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="North Dakota" Value="ND" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Ohio" Value="OH" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Oklahoma" Value="OK" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Oregon" Value="OR" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Pennsylvania" Value="PA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Rhode Island" Value="RI" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="South Carolina" Value="SC" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="South Dakota" Value="SD" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Tennessee" Value="TN" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Texas" Value="TX" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Utah" Value="UT" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Vermont" Value="VT" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Virginia" Value="VA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Washington" Value="WA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="West Virginia" Value="WV" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Wisconsin" Value="WI" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Wyoming" Value="WY" CssClass="stateDropDownText" />
                        </Items>
                    </telerik:RadComboBox>
                    <span class="errorMessage" style="visibility: hidden;">spacer text</span>
                </center>
            </td>
            <td class="addBusinessSpacing">
            </td>
            <td>
                <center>
                    <span class="adminTableLabel">Zip</span>
                    <telerik:RadTextBox ID="zipInput" runat="server" Skin="Web20" Width="150px">
                        <ClientEvents OnFocus="getLatLon" />
                    </telerik:RadTextBox>
                    <asp:RegularExpressionValidator ID="reZipCode" ControlToValidate="zipInput" ValidationExpression="^\d{5}$|^\d{5}-\d{4}$"
                        ErrorMessage="Not a valid Zip code!" Display="static" runat="server" CssClass="errorMessage" />
                    <telerik:RadToolTip runat="server" ID="cantFindLocation" Skin="Web20" Height="100px"
                        Width="400px" ManualClose="true" Position="TopRight" RelativeTo="Element" TargetControlID="streetInput">
                        <span class="normalText">I can't find the address you specified. Please make sure that
                            it is typed in correctly. If you would like to manually find the latitude and longitude,
                            go to <a href="http://itouchmap.com/latlong.html" target="_blank">here</a> and get
                            the coordinates. <a href="#" onclick="getLatLon()">Look Again</a> </span>
                    </telerik:RadToolTip>
                </center>
            </td>
        </tr>
        <tr>
            <td>
                <center>
                    <span class="adminTableLabel">Latitude</span>
                    <telerik:RadTextBox ID="latInput" runat="server" Skin="Web20" Width="150px">
                    </telerik:RadTextBox>
                    <asp:RequiredFieldValidator ID="latValidator" ControlToValidate="latInput" ErrorMessage="Please enter a Latitude"
                        CssClass="errorMessage" runat="server" />
                </center>
            </td>
            <td class="addBusinessSpacing">
            </td>
            <td>
                <center>
                    <span class="adminTableLabel">Longitude</span>
                    <telerik:RadTextBox ID="lonInput" runat="server" Skin="Web20" Width="150px">
                    </telerik:RadTextBox>
                    <asp:RequiredFieldValidator ID="lonValidator" ControlToValidate="lonInput" ErrorMessage="Please enter a Business Name"
                        CssClass="errorMessage" runat="server" />
                </center>
            </td>
            <td>
                <a href="#" onclick="getLatLon()">
                    <asp:Image ID="refresh" runat="server" ImageUrl="~/images/refresh.png" Height="20px"
                        Width="20px" AlternateText="Check coordinates again." />
                </a>
            </td>
        </tr>
    </table>
    <table width="350px">
        <tr>
            <td>
                <center>
                    <asp:Button ID="addEntity" runat="server" Text="Add Entity" /><br />
                    <asp:Label ID="output" runat="server" Text=""></asp:Label>
                    <asp:SqlDataSource ID="usersDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:connectionString %>"
                        SelectCommand="returnAllNonAdminUsers" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
                </center>
                
            </td>
        </tr>
    </table>
    </telerik:RadAjaxPanel>
    
    <telerik:RadAjaxManager runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="businessNameDrop">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="entityNameInput" />
                    <telerik:AjaxUpdatedControl ControlID="streetInput" />
                    <telerik:AjaxUpdatedControl ControlID="cityInput" />
                    <telerik:AjaxUpdatedControl ControlID="stateInput" />
                    <telerik:AjaxUpdatedControl ControlID="zipInput" />
                    <telerik:AjaxUpdatedControl ControlID="latInput" />
                    <telerik:AjaxUpdatedControl ControlID="lonInput" />
                    <telerik:AjaxUpdatedControl ControlID="output" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    
</asp:Content>
Here is the vb code behind for the child page
Imports Telerik.Web.UI
Partial Public Class EditEntity
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Private Sub businessNameDrop_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles businessNameDrop.SelectedIndexChanged
        output.Text = "test"
    End Sub
End Class

I think I have included enough. My dropdown box is populated by the datasource, but for testing purposes you can just give it a couple static child elements. Let me know if I need to post anything else. Thanks for all of your help.
0
Veli
Telerik team
answered on 26 Aug 2009, 11:57 AM
Hello,

I got it working OK. The event fires properly and the event handler is called. The only thing I can spot is that you are using both RadAjaxManger and RadAjaxPanel in one and the same page, which is not supported, and may lead to broken AJAX  on the page. Use one only. Additionally, if you use RadAjaxManager, it needs to go in the master page, where the content page should have a RadAjaxManagerProxy, as described here.

Other than that, I can see that your page does not postback at all when you miss to fill the complete form, due to the large number of required field validator controls.

Shortly, I removed the field validators and set up AJAX properly. The SelectedIndexChanged event works OK.

Best wishes,
Veli
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Web Services
Top achievements
Rank 2
answered on 26 Aug 2009, 08:20 PM
I must be confused then, I thought that elements had to be within an ajax panel and the manager was what controlled the elements that were changed? I have looked through the examples I must be confused.
0
Web Services
Top achievements
Rank 2
answered on 26 Aug 2009, 09:18 PM
So I have stripped my code down and I am still not getting the page to work the way I want. Here is what I have now
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/admin/Admin.Master"
    CodeBehind="EditEntity.aspx.vb" Inherits="ClickableCommunity.EditEntity" %>

<%@ Register Assembly="RadMenu" Namespace="Telerik.WebControls" TagPrefix="radM" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <telerik:RadScriptBlock ID="ScriptBlock1" runat="server">

        <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAANvmC5YwARPSDAHoiTGyjXRR-496V5WiR7LkdzcFVQzFkDe07hhSkvWarTS8udi3TGEWMPQwT-FAGew"
            type="text/javascript"></script>

        <script type="text/javascript">

            function getLatLon(sender, args) {

                var street = $find('<%= streetInput.ClientID %>').get_value();
                var city = $find('<%= cityInput.ClientID %>').get_value();
                var state = $find('<%= stateInput.ClientID %>').get_value();
                var zip = $find('<%= zipInput.ClientID %>').get_value();
                var address = (street + ", " + city + " " + zip);

                geocodeAddress(address);
            } //getLatLon

            //this function takes in an address and returns
            //the lattitude and longitude.
            function geocodeAddress(address) {
                var coder = new GClientGeocoder();
                coder.getLatLng(address,
                              function(point) {
                                  //the id of the tool tip
                                  var toolTip = $find("<%= cantFindLocation.ClientID %>");
                                  if (!point) {

                                      //show the tool tip if it is hidden
                                      if (!toolTip.isVisible()) {
                                          toolTip.show();
                                      } //if
                                      //the tool tip is showing and the clicked the link
                                      else {
                                          toolTip.set_text("Still no dice, <a href=\"#\" onclick=\"getLatLon()\">" +
                                                           "try again</a> or get them <a href=\"" +
                                                           "http://itouchmap.com/latlong.html\" target=\"_blank\"" +
                                                           ">manually</a>.");
                                      } //else
                                  } //if
                                  //we set the textboxes to their values
                                  else {
                                      var templat = $find('<%= latInput.ClientID %>');
                                      var templon = $find('<%= lonInput.ClientID %>');
                                      templat.set_value(point.lat());
                                      templon.set_value(point.lng());

                                      //hide the tooltip if its showing
                                      if (toolTip.isVisible()) {
                                          toolTip.hide();
                                      }

                                  } //else
                              } //function(point)
                            );
            } //geocodeAddress


            
        </script>

    </telerik:RadScriptBlock>
    <style type="text/css">
    .radfdSkinnedFormButton radfd_Web20{
        text-align:center !important;
    }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="header" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <table width="350px">
        <tr>
            <td>
                <center>
                    <span class="adminTableLabel">Select Entity</span>
                    <telerik:RadComboBox ID="businessNameDrop" runat="server" Skin="Web20"
                        Width="150px" MarkFirstMatch="True"
                        DropDownWidth="150px" CssClass="stateDropDownText" Font-Size="16px"
                        DataSourceID="businessDataSource" DataTextField="name"
                        DataValueField="businessid" AutoPostBack="true" >
                        <CollapseAnimation Duration="1000" Type="InOutBack" />
                    </telerik:RadComboBox>
                    <asp:SqlDataSource ID="businessDataSource" runat="server"
                        ConnectionString="<%$ ConnectionStrings:connectionString %>"
                        SelectCommand="getAllBusinesses" SelectCommandType="StoredProcedure">
                    </asp:SqlDataSource>
                </center>
            </td>
            <td class="addBusinessSpacing">
            </td>
            <td></td>
        </tr>
        <tr>
            <td>
                <center>
                    <span class="adminTableLabel">Entity Name</span>
                    <telerik:RadTextBox ID="entityNameInput" runat="server" Skin="Web20" Width="150px">
                    </telerik:RadTextBox>
                    <asp:RequiredFieldValidator ID="valTxtName" ControlToValidate="entityNameInput" ErrorMessage="Please enter a Business Name."
                        CssClass="errorMessage" runat="server" />
                </center>
            </td>
            <td class="addBusinessSpacing">
            </td>
            <td></td>
        </tr>
        <tr>
            <td>
                <center>
                    <span class="adminTableLabel">Street Address</span>
                    <telerik:RadTextBox ID="streetInput" runat="server" Skin="Web20" Width="150px">
                    </telerik:RadTextBox>
                    <asp:RequiredFieldValidator ID="addressValidator" ControlToValidate="streetInput"
                        ErrorMessage="Please enter an address." CssClass="errorMessage" runat="server" />
                </center>
            </td>
            <td class="addBusinessSpacing">
            </td>
            <td>
                <center>
                    <span class="adminTableLabel">City</span>
                    <telerik:RadTextBox ID="cityInput" runat="server" Skin="Web20" Width="150px">
                    </telerik:RadTextBox>
                    <asp:RequiredFieldValidator ID="cityValidator" ControlToValidate="cityInput" ErrorMessage="Please enter a City."
                        CssClass="errorMessage" runat="server" />
                </center>
            </td>
        </tr>
        <tr>
            <td>
                <center>
                    <span class="adminTableLabel">State</span>
                    <telerik:RadComboBox ID="stateInput" runat="server" Skin="Web20" Width="150px" ChangeTextOnKeyBoardNavigation="true"
                        MarkFirstMatch="true" DropDownWidth="150px" CssClass="stateDropDownText" Font-Size="16px">
                        <CollapseAnimation Duration="1000" Type="InOutBack" />
                        <Items>
                            <telerik:RadComboBoxItem Text="Alabama" Value="AL" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Alaska" Value="AK" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Arizona" Value="AZ" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Arkansas" Value="AR" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="California" Value="CA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Colorado" Value="CO" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Connecticut" Value="CT" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Delaware" Value="DE" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="District Of Columbia" Value="DC" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Florida" Value="FL" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Georgia" Value="GA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Hawaii" Value="HI" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Idaho" Value="ID" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Illinois" Value="IL" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Indiana" Value="IN" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Iowa" Value="IA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Kansas" Value="KS" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Kentucky" Value="KY" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Louisiana" Value="LA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Maine" Value="ME" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Maryland" Value="MD" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Massachusetts" Value="MA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Michigan" Value="MI" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Minnesota" Value="MN" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Mississippi" Value="MS" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Missouri" Value="MO" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Montana" Value="MT" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Nebraska" Value="NE" CssClass="stateDropDownText"
                                Selected="true" />
                            <telerik:RadComboBoxItem Text="Nevada" Value="NV" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="New Hampshire" Value="NH" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="New Jersey" Value="NJ" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="New Mexico" Value="NM" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="New York" Value="NY" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="North Carolina" Value="NC" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="North Dakota" Value="ND" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Ohio" Value="OH" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Oklahoma" Value="OK" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Oregon" Value="OR" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Pennsylvania" Value="PA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Rhode Island" Value="RI" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="South Carolina" Value="SC" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="South Dakota" Value="SD" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Tennessee" Value="TN" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Texas" Value="TX" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Utah" Value="UT" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Vermont" Value="VT" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Virginia" Value="VA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Washington" Value="WA" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="West Virginia" Value="WV" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Wisconsin" Value="WI" CssClass="stateDropDownText" />
                            <telerik:RadComboBoxItem Text="Wyoming" Value="WY" CssClass="stateDropDownText" />
                        </Items>
                    </telerik:RadComboBox>
                    <span class="errorMessage" style="visibility: hidden;">spacer text</span>
                </center>
            </td>
            <td class="addBusinessSpacing">
            </td>
            <td>
                <center>
                    <span class="adminTableLabel">Zip</span>
                    <telerik:RadTextBox ID="zipInput" runat="server" Skin="Web20" Width="150px">
                        <ClientEvents OnFocus="getLatLon" />
                    </telerik:RadTextBox>
                    <asp:RegularExpressionValidator ID="reZipCode" ControlToValidate="zipInput" ValidationExpression="^\d{5}$|^\d{5}-\d{4}$"
                        ErrorMessage="Not a valid Zip code!" Display="static" runat="server" CssClass="errorMessage" />
                    <telerik:RadToolTip runat="server" ID="cantFindLocation" Skin="Web20" Height="100px"
                        Width="400px" ManualClose="true" Position="TopRight" RelativeTo="Element" TargetControlID="streetInput">
                        <span class="normalText">I can't find the address you specified. Please make sure that
                            it is typed in correctly. If you would like to manually find the latitude and longitude,
                            go to <a href="http://itouchmap.com/latlong.html" target="_blank">here</a> and get
                            the coordinates. <a href="#" onclick="getLatLon()">Look Again</a> </span>
                    </telerik:RadToolTip>
                </center>
            </td>
        </tr>
        <tr>
            <td>
                <center>
                    <span class="adminTableLabel">Latitude</span>
                    <telerik:RadTextBox ID="latInput" runat="server" Skin="Web20" Width="150px">
                    </telerik:RadTextBox>
                    <asp:RequiredFieldValidator ID="latValidator" ControlToValidate="latInput" ErrorMessage="Please enter a Latitude"
                        CssClass="errorMessage" runat="server" />
                </center>
            </td>
            <td class="addBusinessSpacing">
            </td>
            <td>
                <center>
                    <span class="adminTableLabel">Longitude</span>
                    <telerik:RadTextBox ID="lonInput" runat="server" Skin="Web20" Width="150px">
                    </telerik:RadTextBox>
                    <asp:RequiredFieldValidator ID="lonValidator" ControlToValidate="lonInput" ErrorMessage="Please enter a Business Name"
                        CssClass="errorMessage" runat="server" />
                </center>
            </td>
            <td>
                <a href="#" onclick="getLatLon()">
                    <asp:Image ID="refresh" runat="server" ImageUrl="~/images/refresh.png" Height="20px"
                        Width="20px" AlternateText="Check coordinates again." />
                </a>
            </td>
        </tr>
    </table>
    <table width="350px">
        <tr>
            <td>
                <center>
                    <asp:Button ID="addEntity" runat="server" Text="Add Entity" /><br />
                    <asp:Label ID="output" runat="server" Text=""></asp:Label>
                    <asp:SqlDataSource ID="usersDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:connectionString %>"
                        SelectCommand="returnAllNonAdminUsers" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
                </center>
                
            </td>
        </tr>
    </table>    
</asp:Content>

And here is the vb
Imports Telerik.Web.UI
Partial Public Class EditEntity
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Private Sub businessNameDrop_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles businessNameDrop.SelectedIndexChanged
        output.Text = "test"
    End Sub
End Class

The master page is the same as the previous page. Any thoughts?
0
Veli
Telerik team
answered on 27 Aug 2009, 10:51 AM
Hello Web Services,

Your required field validators prevent the page from postbacking. I noted this on the previous post too. Remove them and you will get RadComboBox postback on selected index changed.

Best wishes,
Veli
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Web Services
Top achievements
Rank 2
answered on 27 Aug 2009, 02:20 PM
Oh, I mis-understood you. I thought you meant they would just "slow down" the postback but not prevent it. I thank you for all of your help, I just started on .net about 3 months ago and have really gotten serious about these controls within the last month or so, so I'm still a noob :).
0
Web Services
Top achievements
Rank 2
answered on 27 Aug 2009, 03:20 PM
Ok, so thanks to all of your help I got it working. I have one last quick question. I put in a loading panel and when the image pops up, the form disappears, this isn't a big deal but is there a way i can keep the form shown while the loading image is displaying? If not, it's no big deal. Here is my code. Thanks again for all of your help

<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/admin/Admin.Master"
    CodeBehind="EditEntity.aspx.vb" Inherits="ClickableCommunity.EditEntity" %>

<%@ Register Assembly="RadMenu" Namespace="Telerik.WebControls" TagPrefix="radM" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <telerik:RadScriptBlock ID="ScriptBlock1" runat="server">

        <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAANvmC5YwARPSDAHoiTGyjXRR-496V5WiR7LkdzcFVQzFkDe07hhSkvWarTS8udi3TGEWMPQwT-FAGew"
            type="text/javascript"></script>

        <script type="text/javascript">

            function getLatLon(sender, args) {

                var street = $find('<%= streetInput.ClientID %>').get_value();
                var city = $find('<%= cityInput.ClientID %>').get_value();
                var state = $find('<%= stateInput.ClientID %>').get_value();
                var zip = $find('<%= zipInput.ClientID %>').get_value();
                var address = (street + ", " + city + " " + zip);

                geocodeAddress(address);
            } //getLatLon

            //this function takes in an address and returns
            //the lattitude and longitude.
            function geocodeAddress(address) {
                var coder = new GClientGeocoder();
                coder.getLatLng(address,
                              function(point) {
                                  //the id of the tool tip
                                  var toolTip = $find("<%= cantFindLocation.ClientID %>");
                                  if (!point) {

                                      //show the tool tip if it is hidden
                                      if (!toolTip.isVisible()) {
                                          toolTip.show();
                                      } //if
                                      //the tool tip is showing and the clicked the link
                                      else {
                                          toolTip.set_text("Still no dice, <a href=\"#\" onclick=\"getLatLon()\">" +
                                                           "try again</a> or get them <a href=\"" +
                                                           "http://itouchmap.com/latlong.html\" target=\"_blank\"" +
                                                           ">manually</a>.");
                                      } //else
                                  } //if
                                  //we set the textboxes to their values
                                  else {
                                      var templat = $find('<%= latInput.ClientID %>');
                                      var templon = $find('<%= lonInput.ClientID %>');
                                      templat.set_value(point.lat());
                                      templon.set_value(point.lng());

                                      //hide the tooltip if its showing
                                      if (toolTip.isVisible()) {
                                          toolTip.hide();
                                      }

                                  } //else
                              } //function(point)
                            );
            } //geocodeAddress


            
        </script>

    </telerik:RadScriptBlock>
    <style type="text/css">
        .radfdSkinnedFormButton radfd_Web20
        {
            text-align: center !important;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="header" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
    <table width="350px">
        
            <tr>
                <td>
                    <center>
                        <span class="adminTableLabel">Select Entity</span>
                        <telerik:RadComboBox ID="businessNameDrop" runat="server" Skin="Web20" Width="150px"
                            MarkFirstMatch="True" DropDownWidth="150px" CssClass="stateDropDownText" Font-Size="16px"
                            DataSourceID="businessDataSource" DataTextField="name" DataValueField="businessid"
                            AutoPostBack="true" AppendDataBoundItems="true">
                            <CollapseAnimation Duration="1000" Type="InOutBack" />
                            <Items>
                                <telerik:RadComboBoxItem Selected="true" Text="- Please Select -" Value="pleaseselect" />
                            </Items>
                        </telerik:RadComboBox>
                        <asp:SqlDataSource ID="businessDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:connectionString %>"
                            SelectCommand="getAllBusinesses" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
                    </center>
                </td>
                <td class="addBusinessSpacing">
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    <center>
                        <span class="adminTableLabel">Entity Name</span>
                        <telerik:RadTextBox ID="entityNameInput" runat="server" Skin="Web20" Width="150px">
                        </telerik:RadTextBox>
                    </center>
                </td>
                <td class="addBusinessSpacing">
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    <center>
                        <span class="adminTableLabel">Street Address</span>
                        <telerik:RadTextBox ID="streetInput" runat="server" Skin="Web20" Width="150px">
                        </telerik:RadTextBox>
                    </center>
                </td>
                <td class="addBusinessSpacing">
                </td>
                <td>
                    <center>
                        <span class="adminTableLabel">City</span>
                        <telerik:RadTextBox ID="cityInput" runat="server" Skin="Web20" Width="150px">
                        </telerik:RadTextBox>
                    </center>
                </td>
            </tr>
            <tr>
                <td>
                    <center>
                        <span class="adminTableLabel">State</span>
                        <telerik:RadComboBox ID="stateInput" runat="server" Skin="Web20" Width="150px" ChangeTextOnKeyBoardNavigation="true"
                            MarkFirstMatch="true" DropDownWidth="150px" CssClass="stateDropDownText" Font-Size="16px">
                            <CollapseAnimation Duration="1000" Type="InOutBack" />
                            <Items>
                                <telerik:RadComboBoxItem Text="Alabama" Value="AL" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Alaska" Value="AK" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Arizona" Value="AZ" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Arkansas" Value="AR" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="California" Value="CA" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Colorado" Value="CO" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Connecticut" Value="CT" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Delaware" Value="DE" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="District Of Columbia" Value="DC" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Florida" Value="FL" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Georgia" Value="GA" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Hawaii" Value="HI" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Idaho" Value="ID" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Illinois" Value="IL" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Indiana" Value="IN" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Iowa" Value="IA" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Kansas" Value="KS" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Kentucky" Value="KY" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Louisiana" Value="LA" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Maine" Value="ME" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Maryland" Value="MD" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Massachusetts" Value="MA" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Michigan" Value="MI" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Minnesota" Value="MN" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Mississippi" Value="MS" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Missouri" Value="MO" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Montana" Value="MT" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Nebraska" Value="NE" CssClass="stateDropDownText"
                                    Selected="true" />
                                <telerik:RadComboBoxItem Text="Nevada" Value="NV" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="New Hampshire" Value="NH" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="New Jersey" Value="NJ" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="New Mexico" Value="NM" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="New York" Value="NY" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="North Carolina" Value="NC" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="North Dakota" Value="ND" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Ohio" Value="OH" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Oklahoma" Value="OK" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Oregon" Value="OR" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Pennsylvania" Value="PA" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Rhode Island" Value="RI" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="South Carolina" Value="SC" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="South Dakota" Value="SD" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Tennessee" Value="TN" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Texas" Value="TX" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Utah" Value="UT" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Vermont" Value="VT" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Virginia" Value="VA" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Washington" Value="WA" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="West Virginia" Value="WV" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Wisconsin" Value="WI" CssClass="stateDropDownText" />
                                <telerik:RadComboBoxItem Text="Wyoming" Value="WY" CssClass="stateDropDownText" />
                            </Items>
                        </telerik:RadComboBox>
                    </center>
                </td>
                <td class="addBusinessSpacing">
                </td>
                <td>
                    <center>
                        <span class="adminTableLabel">Zip</span>
                        <telerik:RadTextBox ID="zipInput" runat="server" Skin="Web20" Width="150px">
                            <ClientEvents OnFocus="getLatLon" />
                        </telerik:RadTextBox>
                        <telerik:RadToolTip runat="server" ID="cantFindLocation" Skin="Web20" Height="100px"
                            Width="400px" ManualClose="true" Position="TopRight" RelativeTo="Element" TargetControlID="streetInput">
                            <span class="normalText">I can't find the address you specified. Please make sure that
                                it is typed in correctly. If you would like to manually find the latitude and longitude,
                                go to <a href="http://itouchmap.com/latlong.html" target="_blank">here</a> and get
                                the coordinates. <a href="#" onclick="getLatLon()">Look Again</a> </span>
                        </telerik:RadToolTip>
                    </center>
                </td>
            </tr>
            <tr>
                <td>
                    <center>
                        <span class="adminTableLabel">Latitude</span>
                        <telerik:RadTextBox ID="latInput" runat="server" Skin="Web20" Width="150px">
                        </telerik:RadTextBox>
                    </center>
                </td>
                <td class="addBusinessSpacing">
                </td>
                <td>
                    <center>
                        <span class="adminTableLabel">Longitude</span>
                        <telerik:RadTextBox ID="lonInput" runat="server" Skin="Web20" Width="150px">
                        </telerik:RadTextBox>
                    </center>
                </td>
                <td>
                    <a href="#" onclick="getLatLon()">
                        <asp:Image ID="refresh" runat="server" ImageUrl="~/images/refresh.png" Height="20px"
                            Width="20px" AlternateText="Check coordinates again." />
                    </a>
                </td>
            </tr>
    </table>
    <table width="350px">
        <tr>
            <td>
                <center>
                    <asp:Button ID="addEntity" runat="server" Text="Add Entity" /><br />
                    <asp:Label ID="output" runat="server" Text=""></asp:Label>
                    <asp:SqlDataSource ID="usersDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:connectionString %>"
                        SelectCommand="returnAllNonAdminUsers" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
                </center>
            </td>
        </tr>
    </table>
    </telerik:RadAjaxPanel>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" SkinID="Web20" Height="75px">
        <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.LoadingProgressBar.gif") %>'
            style="border: 0px;" />
    </telerik:RadAjaxLoadingPanel>
</asp:Content>
0
Veli
Telerik team
answered on 28 Aug 2009, 05:54 AM
Hi,

RadAjaxLoadingPanel provides a Transparency property. Its default value is 100 (completely opaque). Setting it to a smaller value (e.g. Transparency="30") will make your loading panel transparent over the form.

Good luck with your project and do not hesitate to get in touch if any other questions arise. We have all been noobs at one point, there is nothing wrong about it :)

Sincerely yours,
Veli
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Web Services
Top achievements
Rank 2
answered on 28 Aug 2009, 01:37 PM
I had seen that tag in some demos, I just wasn't too for sure what it did. I won't lie, I'm a little timid to change anything when I have something working. I still have to add a calendar that has events shown on client side clicks and has tool tip descriptions pop up so I'm sure I'll be all over these forums. If you want to see the public side of what I am doing you can check it out here http://alpha.clickablecommunity.com Thanks.
0
Veli
Telerik team
answered on 28 Aug 2009, 02:25 PM
Good luck with your project. Let us know if you have difficulties.

Sincerely yours,
Veli
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Ajax
Asked by
Web Services
Top achievements
Rank 2
Answers by
Veli
Telerik team
Web Services
Top achievements
Rank 2
Share this question
or