Hi,
Creating a redirect in razor, how could we generate/get the FriendlyURL for a given page?
Nuno
Hi,
Creating a redirect in razor, how could we generate/get the FriendlyURL for a given page?
Nuno
The methods in Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl can do this for you, e.g.
@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(42) @Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?Id=42")
Best regards,
Mikkel
Hi Mikkel,
Thanks,
Nuno
Hi Guys,
I cannot make it work for a product link.
Anything I am missing?
The code is:
var friendlyURL = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("Default.aspx?id="+catalogPage+"&prodid="+productId+"");
Thanks,
Adrian
Sorry.
I've got it. I was using the wrong prefix. Should be ProductID instead of prodid
What does it return?
I think the product parameter in ecommerce is &productid=
Yes. It was the wrong queryString parameter. ProductID renders it correctly.
Thanks a lot
You must be logged in to post in the forum