Create NavigateUrl Function

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
bradtm
Ensign (ENS)
Ensign (ENS)
Posts: 6
Joined: Tue Jan 12, 2010 9:48 am

Create NavigateUrl Function

Post by bradtm » Tue Jan 12, 2010 9:51 am

Is there a helper function to create the NavigateUrl for a Product without the Product object?

brad

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Create NavigateUrl Function

Post by mazhar » Tue Jan 12, 2010 10:16 am

You can make use of GetBrowseUrl method of CommerceBuilder.Catalog.UrlGenerator class. For example here is sample code

Code: Select all

int productId = 33;
string productName = "All-in-One Printer";
string relativeURL = UrlGenerator.GetBrowseUrl(productId, CatalogNodeType.Product, productName);

bradtm
Ensign (ENS)
Ensign (ENS)
Posts: 6
Joined: Tue Jan 12, 2010 9:48 am

Re: Create NavigateUrl Function

Post by bradtm » Tue Jan 12, 2010 10:32 am

Perfect. Thanks!

Post Reply