Using RadMenu on MasterPage without Page Refresh

2 posts, 0 answers
  1. Evan
    Evan avatar
    22 posts
    Member since:
    May 2008

    Posted 05 Jun 2009 Link to this post

    Hi,

    I'm trying to design a master page with a RadMenu to navigate the user to the appropriate url without a full page refresh. All the pages share the same masterpage and need to find a way to have a loading panel display in the ContentPlaceHolder while only the ContentPlaceHolder refreshes.

    Here is the code:

    MASTER PAGE

    <%@ Master Language="C#" AutoEventWireup="true" CodeFile="DefaultTest.master.cs" Inherits="_Default" %>

    <%
    @ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

     

    <

     

    html>

     

     

    <

     

    head id="Head1" runat="server">

     

     

     

    <title>Default</title>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

     

     

     

    <link rel="Stylesheet" type="text/css" href="CSS/styleExternal.css" />

     

     </

     

    head>

     

     <

     

    body>

     

    <form runat="server">

     


    <
    telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableTheming="True">

     

    </telerik:RadScriptManager>

     


    <
    telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

     

    <AjaxSettings>

     

    <telerik:AjaxSetting AjaxControlID="ContentArea">

     

    <UpdatedControls>

     

    <telerik:AjaxUpdatedControl ControlID="ContentArea" LoadingPanelID="RadAjaxLoadingPanel1" />

     

    </UpdatedControls>

     

    </telerik:AjaxSetting>

     

    </AjaxSettings>

     

     

    </telerik:RadAjaxManager> 

    <
    telerik:RadMenu ID="rmMain" runat="server" Skin="Default">

     

     

     

    <Items>

     

    <telerik:RadMenuItem runat="server" NavigateUrl="~/DefaultTest.aspx" TabIndex="1"  Text="Dashboard">

     

     

    </telerik:RadMenuItem>

     

    <telerik:RadMenuItem runat="server" NavigateUrl="~/DefaultTest2.aspx" TabIndex="2"  Text="School Information">

     

     

    </telerik:RadMenuItem>

     

    </Items>

     

    </telerik:RadMenu>

    <

     

    asp:ContentPlaceHolder ID="ContentArea" runat="server">

     

    </asp:ContentPlaceHolder>

    <

     

    telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">

     

     

     

    <table style="height: 100%; width: 100%" border="0">

     

     

     

    <tr>

     

    <td width="100%" align="center" valign="middle">

     

     

    <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/Loading/loading.gif"></asp:Image>

     

     

     

    </td>

     

     

     

    </tr>

     

     

     

    </table>

     

     

     

    </telerik:RadAjaxLoadingPanel>

    </
    form>

     

    </

     

    body>

     

    </

     

    html>

    Thanks so much for your help.

    Evan

     

     

     

     

     

     

     

     

  2. Arun
    Arun avatar
    15 posts
    Member since:
    Apr 2009

    Posted 29 Jul 2009 Link to this post

    Hi evan U can do it from codebehind and avoid the refresh through Ajax Manager. Check this code. But u need to use the user controls.
    protected void RadMenu1_ItemClick(object sender, Telerik.Web.UI.RadMenuEventArgs e)  
        {  
            if (e.Item.AccessKey.ToString() == "1")  
            {  
                Control control = LoadControl("home.ascx");  
                control.ID = control.ToString();  
                ContentPlaceHolder1.Controls.Clear();  
                ContentPlaceHolder1.Controls.Add(control);  
            }  
            else 
            {  
                Control control = LoadControl("abt.ascx");  
                control.ID = control.ToString();  
                ContentPlaceHolder1.Controls.Clear();  
                ContentPlaceHolder1.Controls.Add(control);  
            }  
        } 
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top