How to block navigation of links and go to click events instead.

4 posts, 0 answers
  1. Noel
    Noel avatar
    10 posts
    Member since:
    Jan 2011

    Posted 07 Jun 2011 Link to this post

    I've got RadPanelBar with Items with navigateUrl property set. I want the click event on these items to go to the Click event in code-behind instead of navigating to the navigateUrl.

    I tried defining a ClientItemClick function for the click event where I set the navigateUrl to null so that it can then go to the code-behind click event.
    But it is not working.

    Is there anything I can do with preventDefault or anything of that sort?

    Thanks and Regards,
    Noel
  2. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 09 Jun 2011 Link to this post

    Hi Noel,

    Probably you will find helpful the following help article:

    http://www.telerik.com/help/aspnet-ajax/menu-itemclick-event-not-fired.html

    Kind regards,
    Helen
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Noel
    Noel avatar
    10 posts
    Member since:
    Jan 2011

    Posted 15 Jun 2011 Link to this post

    Thanks for the solution. But I've a special requirement. I need the navigateUrl to be set so that I can right click on the link and open in the new window. For cases where a normal click is done on the link, I just want to do some tasks in code behind..

    I tried using the OnClientItemClick event, and setting the navigateUrl to "javascript:void(null)" in the event handler, but it is not working.

    Any ideas?
  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 20 Jun 2011 Link to this post

    Hi Noel,

    You could use the same approach described in the article in the previous post for the RadPanelBar. Did you try and what issues did you encounter? Since your scenario is very customized I would suggest that you open a support ticket and address the problem there. Thus you could attach a runnable project that we can inspect locally and help you out with a solution.

    Greetings,
    Kate
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top