IS this possible in RadMenu OnClientItemClicked?

3 posts, 0 answers
  1. Arun
    Arun avatar
    15 posts
    Member since:
    Apr 2009

    Posted 29 Jul 2009 Link to this post

    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);  
            }  
        } 

    Hi. On RadMenu1_ItemClick i dynamically load a usercontrol to the content placeholder and the refresh is handled by the AjaxManager. Thanks to telerik. For further development process i need the above functionality to be done using javascript, Is that possible. If there are any other method to be done please let me know.

    Thanks in Advance
    Arun.M
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 29 Jul 2009 Link to this post

    Hello Arun,

    Unfortunately it is not possible to load a user control entirely on the client-side. You need a postback or ajax request in order to do that.

    Regards,
    Albert
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. mohammad imran rizvi
    mohammad imran rizvi avatar
    3 posts
    Member since:
    Aug 2009

    Posted 15 Apr 2011 Link to this post

    Yes, you can use OnClientItemClick event at javascript, you can set it in RadMenu properties
    There is no septate ClickClick event for items in radmenu, although you can use the main OnClicntItemClick method and later you can differentiate it later , following is the example.


    <telerik:RadContextMenu
      ID
    ="CopyPaster"
      
    runat="server"
      
    OnClientItemClicked="OnClientItemClickedHandler">
    <Items>
       
    <telerik:RadMenuItem Text="Cut" Value="Cut" ExpandMode="ClientSide" />
       
    <telerik:RadMenuItem Text="Copy" Value="Copy" ExpandMode="ClientSide" />
       
    <telerik:RadMenuItem Text="Paste" Value="Paste" ExpandMode="ClientSide" />
    </Items>
    <Targets>
       
    <telerik:ContextMenuElementTarget ElementID="simpleTextArea" />
       
    <telerik:ContextMenuControlTarget ControlID="serverTextBox" />
    </Targets>
    </
    telerik:RadContextMenu>



    <script type="text/javascript">
    function OnClientItemClickedHandler(sender, eventArgs)
    {
    alert(eventArgs.get_Item().get_text());
    }
    </script>

    Regards,
    Mohammad Imran Rizvi
    Zeonsolutions pvt ltd
    Nagpur, India.
    4910022
Back to Top