The problem is easily reproduced with the following example:
ASPX:
Code behind:
After selecting option "1" from the dropdownlist, you see a RadNumericTextBox, in which you can enter any character and not only numbers.(same goes for other controls that use javascript such as DatePicker)
After clicking the button, the controls works like they should.
I've found out that placing the dropdownlist inside the RadAjaxPanel solves the problem, but that's not really what I want in my real web page.
So I'd like to know if I'm not doing it right (I'm not very experienced with the Telerik Ajax controls), or is this a bug?
ASPX:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="Sample.Test" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> <Scripts> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" /> </Scripts> </telerik:RadScriptManager> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="DropDownList1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <div> <asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" AutoPostBack="True" CssClass="inputField"> <asp:ListItem Text="-Select-"></asp:ListItem> <asp:ListItem Text="1" Value="1"></asp:ListItem> <asp:ListItem Text="2" Value="2"></asp:ListItem> </asp:DropDownList> <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"> <asp:Panel ID="Panel1" runat="server" Visible="False" Height="100px" Width="300px"> panel 1 <br /> <telerik:RadNumericTextBox ID="tbNum1" runat="server" MinValue="1"> <NumberFormat DecimalDigits="0"></NumberFormat> </telerik:RadNumericTextBox> </asp:Panel> <asp:Panel ID="Panel2" runat="server" Visible="False"> panel 2 </asp:Panel> </telerik:RadAjaxPanel> <telerik:RadButton ID="RadButton1" runat="server" Text="RadButton" OnClick="RadButton1_Click"></telerik:RadButton> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Metro"> </telerik:RadAjaxLoadingPanel> </div> </form></body></html>Code behind:
using System;namespace Sample{ public partial class Test : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) {
System.Threading.Thread.Sleep(500);
switch (DropDownList1.SelectedIndex) { case 1: { Panel1.Visible = true; Panel2.Visible = false; break; } case 2: { Panel1.Visible = false; Panel2.Visible = true; break; } default: { Panel1.Visible = false; Panel2.Visible = false; break; } } } protected void RadButton1_Click(object sender, EventArgs e) { } }}After selecting option "1" from the dropdownlist, you see a RadNumericTextBox, in which you can enter any character and not only numbers.(same goes for other controls that use javascript such as DatePicker)
After clicking the button, the controls works like they should.
I've found out that placing the dropdownlist inside the RadAjaxPanel solves the problem, but that's not really what I want in my real web page.
So I'd like to know if I'm not doing it right (I'm not very experienced with the Telerik Ajax controls), or is this a bug?