I have a problem with a web page I am developing. Some of the controls on the page are only visible after the user press a button.
One of these is a RadDatePicker.
If the user does some action on the page that triggers a postback when the RadDatePicker is hidden, and then press the button to display it again, then the image on the RadDatePicker is not shown. Instead there will be a text: "Open the calendar popup".
The following sample code demonstrates the problem:
aspx. file:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CalendarTest._Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="rad" %>
<!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>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Release" />
<div>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
<div>
<rad:RadAjaxManagerProxy runat="server">
<AjaxSettings>
<rad:AjaxSetting AjaxControlID="btnToggleSearchMode" EventName="Click">
<UpdatedControls>
<rad:AjaxUpdatedControl ControlID="picker" LoadingPanelID="LoadingPanel1" />
</UpdatedControls>
</rad:AjaxSetting>
</AjaxSettings>
</rad:RadAjaxManagerProxy>
<div>
<rad:RadAjaxPanel ID="RadAjaxPanel1" runat="server" EnableAJAX="true" LoadingPanelID="LoadingPanel1">
<asp:LinkButton ID="btnToggleSearchMode" runat="server" OnClick="btnToggle_Click"
Text="toggle" />
<rad:RadDatePicker ID="picker" runat="server" Visible="false" />
</rad:RadAjaxPanel>
<rad:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" Skin="Office2007" MinDisplayTime="500" />
</div>
</div>
</form>
</body>
</html>
Codebehind:
using System;
using System.Web.UI;
namespace CalendarTest
{
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnToggle_Click(object sender, EventArgs e)
{
picker.Visible = !picker.Visible;
}
}
}
If the button is pressed while the datepicker is hidden, then the datepicker will not display correctly when the toggle is clicked.
Any help appreciated.
One of these is a RadDatePicker.
If the user does some action on the page that triggers a postback when the RadDatePicker is hidden, and then press the button to display it again, then the image on the RadDatePicker is not shown. Instead there will be a text: "Open the calendar popup".
The following sample code demonstrates the problem:
aspx. file:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CalendarTest._Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="rad" %>
<!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>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Release" />
<div>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
<div>
<rad:RadAjaxManagerProxy runat="server">
<AjaxSettings>
<rad:AjaxSetting AjaxControlID="btnToggleSearchMode" EventName="Click">
<UpdatedControls>
<rad:AjaxUpdatedControl ControlID="picker" LoadingPanelID="LoadingPanel1" />
</UpdatedControls>
</rad:AjaxSetting>
</AjaxSettings>
</rad:RadAjaxManagerProxy>
<div>
<rad:RadAjaxPanel ID="RadAjaxPanel1" runat="server" EnableAJAX="true" LoadingPanelID="LoadingPanel1">
<asp:LinkButton ID="btnToggleSearchMode" runat="server" OnClick="btnToggle_Click"
Text="toggle" />
<rad:RadDatePicker ID="picker" runat="server" Visible="false" />
</rad:RadAjaxPanel>
<rad:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" Skin="Office2007" MinDisplayTime="500" />
</div>
</div>
</form>
</body>
</html>
Codebehind:
using System;
using System.Web.UI;
namespace CalendarTest
{
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnToggle_Click(object sender, EventArgs e)
{
picker.Visible = !picker.Visible;
}
}
}
If the button is pressed while the datepicker is hidden, then the datepicker will not display correctly when the toggle is clicked.
Any help appreciated.