I have two update panel , one having button and another having place holder. when I click button and load control dynamically in other update panel place holder, the skin of the of the combobox does not get loaded properly.
If I do not place the button in the update panel then evrything works fine. but in my application I have to use two update panel so I cannot think of removing the update panel.
Thanks & Regards,
Vaibhav Goel
the Code which I am using is as below
ASPX:
<%
@ Page Language="C#" AutoEventWireup="true" CodeFile="DynamicLoadControl.aspx.cs" Inherits="DynamicLoadControl" %>
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!
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>Untitled Page</title>
</
head>
<
body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div>
<asp:Button id="cmdLoadControl" runat="server" OnClick="cmdLoadControl_Click" Text="Load Control 1" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
<table cellpadding="0" cellspacing="0" style="height: 100%; background-color: white;
border-top-width: thin; border-left-width: thin; border-left-color: black; border-bottom-width: thin;
border-bottom-color: black; border-top-color: black; border-right-width: thin;
border-right-color: black; width: 100%; position: static;"
width="100%">
<tr>
<td>
<asp:UpdatePanel id="pnluCompanyData" runat="server" UpdateMode="Conditional">
<contenttemplate>
<asp:PlaceHolder id="CtrlPlaceholder" runat="server">
</asp:PlaceHolder>
</contenttemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</form>
</
body>
</
html>
ASPX.CS
using
System;
using
System.Data;
using
System.Configuration;
using
System.Collections;
using
System.Web;
using
System.Web.Security;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Web.UI.WebControls.WebParts;
using
System.Web.UI.HtmlControls;
public
partial class DynamicLoadControl : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void cmdLoadControl_Click(object sender, EventArgs e)
{
CtrlPlaceholder.Controls.Clear();
Control cntDynamicControl = LoadControl("DynamicControl.ascx");
cntDynamicControl.ID =
"DynamicControl";
CtrlPlaceholder.Controls.Add(cntDynamicControl);
pnluCompanyData.Update();
}
}
ASCX
<%
@ Control Language="C#" AutoEventWireup="true" CodeFile="DynamicControl.ascx.cs" Inherits="DynamicControl" %>
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<
telerik:RadComboBox id="drpEvaluationMonth" runat="server"
AutoPostBack="True" >
<Items >
<telerik:RadComboBoxItem runat="server" Text="1" />
<telerik:RadComboBoxItem runat="server" Text="2" />
<telerik:RadComboBoxItem runat="server" Text="3" />
<telerik:RadComboBoxItem runat="server" Text="4" />
<telerik:RadComboBoxItem runat="server" Text="5" />
<telerik:RadComboBoxItem runat="server" Text="6" />
</Items>
<CollapseAnimation Duration="200" Type="OutQuint" />
<ExpandAnimation Type="OutQuart" />
</
telerik:RadComboBox>