Friday, February 24, 2012

Page.ResolveURL in ASP.NET. using '~' in non asp.net controls

I just discovered this, and what a cool function, i have a 'user control' .ascx that i need to work irregardless of where it placed, issue i have was with image links and links to CSS, but just by doing this:-

<link href="<%=Page.ResolveUrl("~/globalFiles/css3/layout.forMenu.css")%>" rel="stylesheet" type="text/css" />

i can easily place my control anywhere.

Hope this helps


No comments: