We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Menu NavigateUrl

If I set the ClientSideOnItemSelect on the menu to be a javascript function listed below.

function DoSomething(oMenu)
{
alert(oMenu.NavigateUrl);
return false;
}

Then set all the MenuItems to have a value for the NavigateUrl. Why am I getting a messagebox that displays "undefined" rather than the NavigateUrl? Am I suppose to be accessing this attribute in another way?

Thanks

Chad

3 Replies

VA Valli Syncfusion Team February 22, 2007 11:50 AM UTC

Hi Chad,

The navigation url is passed as an argument to the javascript function which is invoked by the 'ClientSideOnItemSelect' property of the Menu Control.

Herewith attached a sample which illustrates the above.

http://www.syncfusion.com/Support/user/uploads/Menu_d0e1d4e9.zip

Please let us know if this helps you.

Thanks for using Syncfusion products.

Regards,
Valli


CD Chad Dunham February 22, 2007 04:02 PM UTC

Valli -

Thanks for the response. I have attached an updated version of the sample that you sent me. This new sample adds two new toplevel MenuItems to the menu (and one MenuItem to each of these) in the Page Load event. These new MenuItems look identical to me in the rendered HTML script. However, they function differently than those MenuItems that were added to the Items collection in the HTML source page. Why is this?

Thanks

Chad

Menu3.zip


VA Valli Syncfusion Team February 23, 2007 09:25 AM UTC

Hi Chad,

When the ClientSide function is defined in C# code, the arguments passed to the function should be embedded in quotes as below.

"GetNavigationUrl('http://www.syncfusion.com')"

The problem with Menu3.zip sample is '"' have been used to embed the arguments. '"' will be recognized only in the aspx page which accepts the html format.

Herewith I have attached the sample in which the reported issue has been rectified.

http://www.syncfusion.com/Support/user/uploads/Menu_c8a37cc1.zip

Please let us know if you have any other concerns.

Regards,
Valli

Loader.
Live Chat Icon For mobile
Up arrow icon