This is a migrated thread and some comments may be shown as answers.

LoadingPanel inside a tabstrip problem

2 Answers 69 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Orlando
Top achievements
Rank 1
Orlando asked on 11 May 2012, 06:42 PM
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 

<%@ 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.

2 Answers, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 16 May 2012, 10:09 AM
Hi Orlando,

The situation with the loading panel is the following.This panel is only shown during the execution of an Ajax request, in the scenario that you are implementing, when the pageview is loaded on the page additional Get request is made in order to load the content defined by the ContentUrl property. Since this is not an Ajax request, but a general HTTP Get one the loading panel is not shown. If you need to show some animation or manually show the loading panel the implementation from the following code library could be used.

Greetings,
Dimitar Terziev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Orlando
Top achievements
Rank 1
answered on 16 May 2012, 04:54 PM
Thanks for the response Dimitar, i will see the manual mode for this.


regards,
Orlando.
Tags
TabStrip
Asked by
Orlando
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Orlando
Top achievements
Rank 1
Share this question
or