Redirecting without refreshing(with ajax event) By Menu items

  1. #1

    Redirecting without refreshing(with ajax event) By Menu items


    Hi,

    I have a master page and menu items in it at the left sight.

    I would like to redirect mypage by clicking menu items. Please see the code below.

    it is working but with refreshing a page.

    
               <ext:ScriptManager runat="server" />
    
      <Body>
    <ext:Accordion ID="AccordionLayout1" runat="server">
                <ext:MenuPanel ID="MenuPanel1" runat="server" Title="Modules" Icon="ArrowSwitch">
                    <Menu>
                        <Items>
                            <ext:MenuItem ID="NewModule" runat="server" Text="Add new Module" Icon="ArrowRight" />
                            <ext:MenuItem ID="ModuleList"  runat="server" Text="Module List" Icon="ArrowRight" />
                            <ext:MenuItem ID="ModulePlacement" runat="server" Text="Change module place" Icon="ArrowRight" />
                        </Items>
                        
                                            
                        <AjaxEvents>
                            <ItemClick OnEvent="MenuItemClickAjax" >
                            <EventMask ShowMask="true" />
                            <ExtraParams>
                                <ext:Parameter Name="title" Value="e.text" />
                            </ExtraParams>
                                
                            </ItemClick>
                        </AjaxEvents>
                                                             
                    </Menu>                                        
                </ext:MenuPanel>
    
    <ext:MenuPanel ID="MenuPanel2" runat="server" Title="Menu panel without selection saving" SaveSelection="false" Icon="ArrowSwitch">
                    <Menu>
                        <Items>
                            <ext:MenuItem ID="MenuItem10" runat="server" Text="Point 1" Icon="ArrowRight" />
                            <ext:MenuItem ID="MenuItem11" runat="server" Text="Point 2" Icon="ArrowRight" />
                            <ext:MenuItem ID="MenuItem12" runat="server" Text="Point 3" Icon="ArrowRight" />
                            <ext:MenuItem ID="MenuItem13" runat="server" Text="Point 4" Icon="ArrowRight" />
                            <ext:MenuItem ID="MenuItem14" runat="server" Text="Point 5" Icon="ArrowRight" />
                            <ext:MenuItem ID="MenuItem15" runat="server" Text="Point 6" Icon="ArrowRight" />
                            <ext:MenuItem ID="MenuItem16" runat="server" Text="Point 7" Icon="ArrowRight" />
                            <ext:MenuItem ID="MenuItem17" runat="server" Text="Point 8" Icon="ArrowRight" />
                            <ext:MenuItem ID="MenuItem18" runat="server" Text="Point 9" Icon="ArrowRight" />
                        </Items>
                    </Menu>
                </ext:MenuPanel>
    
            </ext:Accordion>
        </Body>
    
    
            [AjaxMethod]
            protected void MenuItemClickAjax(object sender, AjaxEventArgs e)
            {
                Ext.Redirect("ModuleList.aspx");
            }

    is it possible that redirecting a page without refreshing(postback) ?

    or can I select the menu item in the redirected page in the menu? (otherwise I cannot fiigure out that in which item I have been working on)

    Thank you in advance..



  2. #2

    RE: Redirecting without refreshing(with ajax event) By Menu items

    Hi Latif.

    What do you menad with "redirect without refresh"?

    When you redirect you change page, generally, so actually you shouldn't have a post back as this would be the first time you enter the page (the "Page.IsPostback" property should be false).

    If you need to know what you have pressed you could add a QueryString parameter together with the redirect:
      [AjaxMethod]
            protected void MenuItemClickAjax(object sender, AjaxEventArgs e)
            {
                Ext.Redirect("ModuleList.aspx?idMenuPressed=" + YOUR_PARAM);
            }
    Hope this help.

    Lorenzo
  3. #3

    RE: Redirecting without refreshing(with ajax event) By Menu items

    Hi Lorenzo,

    Sorry for confusing. You are right, redirecting a page always requires post back.

    At first, I thought, I can redirect the page itself via AjaxMethod but it is not reasonable without postback.

    Actually, what I would like to do is that I just want to load my user controls on the AjaxMethod(for each menu items). (Actually you have given a suggestion about this in my another post)


    If you have an another suggestion. please let me know.

    Thank you.


Similar Threads

  1. Replies: 0
    Last Post: Aug 09, 2012, 5:37 AM
  2. Replies: 2
    Last Post: May 21, 2012, 9:25 AM
  3. [CLOSED] Adding menu items with Ajax Event
    By gokcemutlu in forum 1.x Legacy Premium Help
    Replies: 13
    Last Post: Apr 21, 2011, 10:07 AM
  4. [CLOSED] Is it possible to Select Items of a multi select during ajax event
    By vedagopal2004 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 29, 2010, 6:28 PM
  5. [CLOSED] [1.0] MVC sample west menu has no menu items
    By Inoventus in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Nov 24, 2009, 4:06 AM

Posting Permissions