[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1910
  • Last Modified:

How to make ItemClick event work on RadMenu

I need a server side function when I click LogOff RadMenuItem. I used ItemClick event on RadMenu.
<div style="height: 20px; width: 100%;">            
       <telerik:RadMenu ID="RadMenu1" runat="server" Style="float: none; width:100%; "
                Skin="Black" ItemClick="LogoffClick">                
                <Items>                
                    <telerik:RadMenuItem Text="HOME" NavigateUrl="Home.aspx">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Text="QUERY" NavigateUrl="Query.aspx">
                    <Items>
                    <telerik:RadMenuItem Text="LISTING" NavigateUrl="View.aspx">
                    </telerik:RadMenuItem>
                    </Items>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Text="Record" NavigateUrl="Record.aspx">
                    <Items>
                     <telerik:RadMenuItem Text="CREATE" NavigateUrl="create.aspx"></telerik:RadMenuItem>
                     <telerik:RadMenuItem Text="SEARCH" NavigateUrl="Search.aspx"></telerik:RadMenuItem>                    
                     </Items>                    
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Text="REPORT" NavigateUrl="Report.aspx">
                     <Items>
                     <telerik:RadMenuItem Text="HISTORY"></telerik:RadMenuItem>
                     </Items>
                    </telerik:RadMenuItem>

                    <telerik:RadMenuItem Text="LOGOFF" ></telerik:RadMenuItem>                
                </Items>
            </telerik:RadMenu>
 </div>  

C# side -  
protected void LogoffClick(object sender, Telerik.Web.UI.RadMenuEventArgs e)
{
       Telerik.Web.UI.RadMenuItem ItemClicked = e.Item;
       Response.Write("Server event raised -- you clicked: " + ItemClicked.Text);
}

I can complipe and run the application, but cannot debug into the above LogoffClick function. When I click the LOGOFF menu, nothing happens. I need to do sonething inside the function. Please help.
I take reference from http://www.telerik.com/help/aspnet-ajax/menu_serversideitemclick.html
0
minglelinch
Asked:
minglelinch
  • 2
1 Solution
 
MlandaTCommented:
Your declaration looks incorrect there ItemClick="LogoffClick" should be OnItemClick="LogoffClick"
<telerik:RadMenu ID="RadMenu1" runat="server" Style="float: none; width:100%;" Skin="Black" OnItemClick="LogoffClick">  

Open in new window

0
 
minglelinchAuthor Commented:
Hm ... my careless? It has taken me two days.
Thank a lot,  MlandaT.
0
 
minglelinchAuthor Commented:
good comments.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now