Redirect WebApplication from aspx page in RadPane

4 posts, 0 answers
  1. Ali
    Ali avatar
    1 posts
    Member since:
    Feb 2012

    Posted 26 Feb 2012 Link to this post

    Hi,
    I put a RadSplitter onto a Page that has two vertical pane. On the left side there is a navigation menu. If you click on an item of the menu, it will open the .aspx pages on the right side next to the navigation menu. Now I want to redirect web application from pages that open in right side pane(I want to redirect to a complete new website , for example Default.aspx).
    I want to use it for users policy and if session expired redirect web application to default.aspx for login
    How can I fix it?

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AppMain.aspx.cs" Inherits="MapnaWarrantySystem.AppMain" %>
     
    <%@ 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">
    <head runat="server">
        <title>Mapna Warranty System</title>
        <link rel="icon" href="Images/mapna.ico" type="image/x-icon" />
        <telerik:RadCodeBlock ID="RadCodeBlockMain" runat="server">
            <script language="javascript" type="text/javascript">
                function getItemValue(sender, eventArgs) {
                    if (eventArgs.get_item().get_value() != null) {
                        var obj = window.radopen(eventArgs.get_item().get_value(), eventArgs.get_item().get_text());
                    }
                }
            </script>
        </telerik:RadCodeBlock>
        <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <form id="formMain" runat="server">
        <telerik:RadScriptManager ID="RadScriptManagerMain" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManagerMain" runat="server">
        </telerik:RadAjaxManager>
        <telerik:RadWindowManager ID="RadWindowManagerMain" runat="server" Animation="Fade"
            AutoSize="True" AutoSizeBehaviors="Width, Height, Default" ReloadOnShow="True"
            ShowContentDuringLoad="False" Skin="WebBlue" MinHeight="300px" MinWidth="400px"
            EnableShadow="True" IconUrl="../Images/mapna.ico" VisibleStatusbar="False">
        </telerik:RadWindowManager>
        <div style="width: 100%;" align="center">
            <div style="float: left; width: 100%; margin: 0px; padding: 0px; background: #4b6c9e;"
                align="left">
                <table cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td width="110">
                            <img alt="" src="Images/mapna.png" width="103" />
                        </td>
                        <td align="left" width="300">
                            <span style="font-family: Tahoma; font-size: 30px; font-weight: bold; text-transform: none;
                                color: #CBCEFA">MWS </span><span style="font-family: Tahoma; font-size: small; font-weight: bold;
                                    text-transform: none; color: #B1B7F8">(MLC Warranty Software)</span>
                        </td>
                        <td align="right">
                            <asp:Label ID="lblUserName" runat="server" Font-Names="Tahoma"
                                Font-Size="Medium" ForeColor="#8FCBCA"></asp:Label>
                        </td>
                        <td width="80">
     
                            <asp:LinkButton ID="lbLogout" runat="server" Font-Names="Tahoma"
                                Font-Size="Medium" ForeColor="#FFFF66" onclick="lbLogout_Click">Log Out</asp:LinkButton>
     
                        </td>
                    </tr>
                </table>
            </div>
            <div style="clear: both; font-size: 1px;">
            </div>
            <div style="width: 1200px; height: 700px;" align="center">
                <div style="width: 100%; height: 100%; float: left;">
                    <telerik:RadAjaxPanel ID="RadAjaxPanelMain" runat="server" Height="100%" Width="100%">
                        <telerik:RadSplitter ID="RadSplitterMain" runat="server" Width="100%" Height="100%"
                            Skin="WebBlue">
                            <telerik:RadPane ID="RadPane1" runat="server" MinWidth="100" Width="250px" MaxWidth="300"
                                BackColor="#DFDFFF" ShowContentDuringLoad="False">
                                <telerik:RadPanelBar runat="server" ID="RadPanelBarTools" Height="100%" Skin="WebBlue"
                                    OnClientItemClicked="getItemValue" BackColor="#DFDFFF">
                                    <Items>
                                        <telerik:RadPanelItem runat="server" Text="Claims">
                                            <Items>
                                                <telerik:RadPanelItem runat="server" Text="New" Value="frm_Claims_Add.aspx">
                                                </telerik:RadPanelItem>
                                                <telerik:RadPanelItem runat="server" Text="Sent" Value="frm_Claims_Edit.aspx">
                                                </telerik:RadPanelItem>
                                            </Items>
                                        </telerik:RadPanelItem>
                                        <telerik:RadPanelItem Text="Cartable" Owner="RadPanelBarTools">
                                            <Items>
                                                <telerik:RadPanelItem runat="server" Text="">
                                                    <ItemTemplate>
                                                        <telerik:RadTreeView ID="RadTreeView1" runat="server" OnNodeClick="RadTreeView1_NodeClick">
                                                            <Nodes>
                                                                <telerik:RadTreeNode runat="server" Text="Inbox" Value="Cartable_Inbox.aspx">
                                                                </telerik:RadTreeNode>
                                                                <telerik:RadTreeNode runat="server" Text="Pending" Value="Cartable_Pending.aspx">
                                                                </telerik:RadTreeNode>
                                                                <telerik:RadTreeNode runat="server" Text="Sent" Value="Cartable_Sent.aspx">
                                                                </telerik:RadTreeNode>
                                                            </Nodes>
                                                        </telerik:RadTreeView>
                                                    </ItemTemplate>
                                                </telerik:RadPanelItem>
                                            </Items>
                                        </telerik:RadPanelItem>
                                        <telerik:RadPanelItem Text="Control Panel" Owner="RadPanelBarTools">
                                            <Items>
                                                <telerik:RadPanelItem Text="Failure Items" Value="/Admin/frmFailures.aspx">
                                                </telerik:RadPanelItem>
                                                <telerik:RadPanelItem Text="Locomotive Basic Informations" Value="/Admin/frmLocomotiveGroupsCtrl.aspx">
                                                </telerik:RadPanelItem>
                                                <telerik:RadPanelItem Text="Claims (Add)" Value="/Admin/frmClaims.aspx">
                                                </telerik:RadPanelItem>
                                                <telerik:RadPanelItem runat="server" Owner="" Text="Claims (Edit)" Value="/Admin/frmClaimsEdit.aspx">
                                                </telerik:RadPanelItem>
                                                <telerik:RadPanelItem runat="server" Text="Consortium members"
                                                    Value="/Admin/frmConsortiumMembers.aspx">
                                                </telerik:RadPanelItem>
                                                <telerik:RadPanelItem runat="server" Text="Locomotive stop reasons"
                                                    Value="/Admin/frmLocomotiveStopReasons24.aspx">
                                                </telerik:RadPanelItem>
                                            </Items>
                                        </telerik:RadPanelItem>
                                        <telerik:RadPanelItem Text="Reports" Owner="RadPanelBarTools">
                                            <Items>
                                                <telerik:RadPanelItem Text="Report1">
                                                </telerik:RadPanelItem>
                                            </Items>
                                        </telerik:RadPanelItem>
                                    </Items>
                                </telerik:RadPanelBar>
                            </telerik:RadPane>
                            <telerik:RadSplitBar ID="RadSplitBar1" runat="server" CollapseMode="Forward">
                            </telerik:RadSplitBar>
                            <telerik:RadPane ID="RadPane2" runat="server" MinWidth="400" BackColor="#DFDFFF"
                                ShowContentDuringLoad="False" Scrolling="Y">
                                 
                            </telerik:RadPane>
                        </telerik:RadSplitter>
                    </telerik:RadAjaxPanel>
                </div>
                <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanelMain" runat="server" Skin="Office2010Black">
                </telerik:RadAjaxLoadingPanel>
                <div style="clear: both; font-size: 1px;">
                </div>
            </div>
        </div>
        </form>
    </body>
    </html>

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserID"] == null)
            Response.Redirect("Default.aspx");
     
        //Users.Name, Users.Family, UsersGroup.Name
        string[] Name = BL.tbl_Users.Get_Name_Family_GroupName(Session["UserID"].ToString());
        lblUserName.Text = Name[2] + " ";
    }
     
    protected void RadTreeView1_NodeClick(object sender, RadTreeNodeEventArgs e)
    {
        if (e.Node.Value != "")
            RadPane2.ContentUrl = e.Node.Value;
    }
     
    protected void lbLogout_Click(object sender, EventArgs e)
    {
        Session.Clear();
        Session.RemoveAll();
        Response.Redirect("Default.aspx");
    }

  2. jumpstart
    jumpstart avatar
    479 posts
    Member since:
    Nov 2011

    Posted 27 Feb 2012 Link to this post

    Ali:

    I believe that since your application is using AJAX, you can use the RadAjaxManager.Redirect() or RadAjaxPanel.Redirect() method to accomplish your requirement. See the Redirecting to Another Page documentation for insights.

    Hope this helps!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tin
    Tin avatar
    9 posts
    Member since:
    Jan 2012

    Posted 11 Jan 2013 Link to this post

    How to redirect back to Default page  from content Pane .

    I used Ajax Manager Redirect . But it can't achieved my purpose. Called default page is in order to refresh the page.

    if (Session["DirString"] != null)
                    {
                        cDealLead = Session["cDealLead"].ToString();
                    }
                    else
                    { radAjaxMgr.Redirect("Home.aspx"); }
  5. Vessy
    Admin
    Vessy avatar
    1380 posts

    Posted 16 Jan 2013 Link to this post

    Hi Tin,

    I have already answered your question in the other forum thread.

    Regards,
    Vesi
    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.
Back to Top