Hello, i have a radTabStrip with a radmultipage (and radpageview) inside. I put the radajaxmanager for show the loadingpanel when the page inside of the multipage loading but, the loading panel only appear a few second and hide when the page still does not load completely.
Here's my code...
TTabStrip.ascx
CODE BEHIND
Orlando.
Here's my code...
TTabStrip.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TTabStrip.ascx.cs" Inherits="OmegaWeb.WebControls.Seguridad.TTabStrip" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<
telerik:RadAjaxLoadingPanel
runat
=
"server"
ID
=
"LoadingPanel1"
Height
=
"75px"
Width
=
"75px"
>
</
telerik:RadAjaxLoadingPanel
>
<
telerik:RadTabStrip
ID
=
"RadTabStrip1"
SelectedIndex
=
"0"
CssClass
=
"tabStrip"
runat
=
"server"
MultiPageID
=
"RadMultiPage1"
Skin
=
"Default"
AutoPostBack
=
"true"
ShowBaseLine
=
"True"
ClickSelectedTab
=
"True"
ontabclick
=
"RadTabStrip1_TabClick"
>
</
telerik:RadTabStrip
>
<
telerik:RadAjaxManager
runat
=
"server"
ID
=
"RadAjaxManagerProxy1"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadTabStrip1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadTabStrip1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadMultiPage1"
LoadingPanelID
=
"LoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadMultiPage1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadTabStrip1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadMultiPage1"
LoadingPanelID
=
"LoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadMultiPage
ID
=
"RadMultiPage1"
runat
=
"server"
SelectedIndex
=
"0"
EnableEmbeddedScripts
=
"true"
>
<
telerik:RadPageView
ID
=
"RadPageView1"
runat
=
"server"
>
</
telerik:RadPageView
>
</
telerik:RadMultiPage
>
CODE BEHIND
public partial class TTabStrip : System.Web.UI.UserControl
{
protected void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
DrillDownModel drillDown = GenericController<
DrillDownModel
>.Current;
List<
TabStripModel
> tabs = SecurityInfo.GetTabStripsUsuario(drillDown);
if (!SecurityInfo.HasAccessToDrillDown(drillDown))
{
NotifyNoAccess(drillDown);
Server.Transfer("/NoAccessPage.aspx", false);
return;
}
tabs.ForEach(tab => AddTab(tab.Texto, tab.TargetDrillDownId == 0 ? tab.URL :
string.Format("/WebForms/DrillDown/DrillDownRedirect.aspx?TS={0}", tab.Id)));
setPersistTab();
}
}
private void setPersistTab()
{
string sessionTabId = string.Format("DrillDown_{0}", GenericController<
DrillDownModel
>.CurrentId);
string tabName;
if (HttpContext.Current.Session[sessionTabId] != null)
{
tabName = HttpContext.Current.Session[sessionTabId].ToString();
RadTab tab = RadTabStrip1.FindTabByText(tabName);
if (tab != null)
{
tab.Selected = true;
RadPageView1.ContentUrl = tab.Value;
}
}
else
{
RadTab tab = RadTabStrip1.Tabs.FirstOrDefault();
if (tab != null)
{
tab.Selected = true;
RadPageView1.ContentUrl = tab.Value;
}
}
}
private void AddTab(string tabName, string tabValue)
{
RadTab tab = new RadTab(tabName, tabValue);
RadTabStrip1.Tabs.Add(tab);
}
private void NotifyNoAccess(DrillDownModel drilldown)
{
MailMessage mail = new MailMessage();
mail.From = new MailAddress("Omega@uai.cl");
mail.To.Add(ConfigurationManager.AppSettings["Omega Team"]);
mail.Subject = "Acceso DrillDown - Omega";
mail.IsBodyHtml = false;
StringBuilder body = new StringBuilder();
body.AppendLine(string.Format("DrillDownId:{0}", drilldown.Id));
body.AppendLine(string.Format("Nombre DrillDown:{0}", drilldown.Titulo));
body.AppendLine(string.Format("UsuarioId: {0}", SecurityInfo.LoginUser.Id));
body.AppendLine(string.Format("Usuario: {0}", SecurityInfo.LoginUser.GetPersonaRef()._ApellidosNombre));
body.AppendLine(string.Format("AUTH_USER: {0}", Request.ServerVariables["AUTH_USER"]));
body.AppendLine(string.Format("LOGON_USER: {0}", Request.ServerVariables["LOGON_USER"]));
body.AppendLine(string.Format("REMOTE_USER: {0}", Request.ServerVariables["REMOTE_USER"]));
body.AppendLine(string.Format("REMOTE_ADDR: {0}", Request.ServerVariables["REMOTE_ADDR"]));
body.AppendLine(string.Format("REMOTE_HOST: {0}", Request.ServerVariables["REMOTE_HOST"]));
body.AppendLine(string.Format("SERVER_NAME: {0}", Request.ServerVariables["SERVER_NAME"]));
mail.Body = body.ToString();
SmtpClient smtp = new SmtpClient(ConfigurationManager.AppSettings["SMTPServer"]);
smtp.Send(mail);
}
protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
{
string sessionTabId = string.Format("DrillDown_{0}", GenericController<
DrillDownModel
>.CurrentId);
HttpContext.Current.Session[sessionTabId] = e.Tab.Text;
RadPageView1.ContentUrl = e.Tab.Value;
RadPageView1.ResolveUrl(e.Tab.Value);
}
}
Orlando.