This is a migrated thread and some comments may be shown as answers.

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

3 Answers 42 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Noel
Top achievements
Rank 1
Noel asked on 07 Jun 2011, 09:00 AM
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

3 Answers, 1 is accepted

Sort by
0
Helen
Telerik team
answered on 09 Jun 2011, 10:18 AM
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.

0
Noel
Top achievements
Rank 1
answered on 15 Jun 2011, 07:58 AM
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?
0
Kate
Telerik team
answered on 20 Jun 2011, 05:50 PM
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.

Tags
PanelBar
Asked by
Noel
Top achievements
Rank 1
Answers by
Helen
Telerik team
Noel
Top achievements
Rank 1
Kate
Telerik team
Share this question
or