Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Get actual URL without querystring parameters View modes: 
User avatar
Member
Member
jp.principio.mail-gmail - 1/30/2012 1:18:17 AM
   
Get actual URL without querystring parameters
Hi,

Do we have a code to get the actual url without the querystring parameters?


eg:

www.yahoo.com/default.aspx?name=jp

I would like to get the
www.yahoo.com/default.aspx

I am using "CMS.GlobalHelper.UrlHelper.CurrentURL" but it also returns the querystring

Thanks,

JP

User avatar
Kentico Support
Kentico Support
kentico_radekm - 1/30/2012 1:41:04 AM
   
RE:Get actual URL without querystring parameters
Hello.

Could you please try to use following code instead?

string sUrlWithoutParameters = CMS.GlobalHelper.URLHelper.RemoveQuery(CMS.GlobalHelper.URLHelper.RawUrl);

Thank you.

Best Regards,
Radek Macalik


User avatar
Member
Member
jp.principio.mail-gmail - 1/30/2012 1:58:17 AM
   
RE:Get actual URL without querystring parameters
kentico_radekm wrote: Hello.

Could you please try to use following code instead?

string sUrlWithoutParameters = CMS.GlobalHelper.URLHelper.RemoveQuery(CMS.GlobalHelper.URLHelper.RawUrl);

Thank you.

Best Regards,
Radek Macalik



You saved me! Thanks! It works!

-JP