<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<asp:updatepanel id="pnl1" runat="server">
<contenttemplate>
<asp:placeholder id="plh1" runat="server"></asp:PlaceHolder>
</contenttemplate>
</asp:UpdatePanel>
private string LastLoadedControl
{
get
{
return ViewState["LastLoaded"] as string;
}
set
{
ViewState["LastLoaded"] = value;
}
}
private void LoadUserControl()
{
string controlPath = LastLoadedControl;
if (!string.IsNullOrEmpty(controlPath))
{
plh1.Controls.Clear();
UserControl uc = (UserControl)LoadControl(controlPath);
plh1.Controls.Add(uc);
}
}
protected void Page_Load(object sender, EventArgs e)
{
DotNetNuke.Framework.AJAX.RegisterScriptManager();
string controlPath = string.Empty;
if (Settings.ContainsKey("ddl1"))
controlPath = Settings["ddl1"] + ".ascx";
else
controlPath = "Expired.ascx";
LastLoadedControl = controlPath;
LoadUserControl();
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment