posted 7/6/2011 by Raghav Khunger
A person asked me today that whether we can use tild(~) with HTML controls on ASP.NET pages without using runat server attribute. I replied him, yes, this is possible. We can write our controls like this:
<a href='<%= Page.ResolveUrl("~/controls/mypage.aspx") %>'>XXX</a>
Though I prefer using tild with runat server attribute but yes the above one can be other option too while making use of tild with HTML controls.
Interesting... I use this way a lot, especially when I need to ensure the resources (not only links) will be loaded properly in N different levels within the application.
What kind of email newsletter would you prefer to receive from CodeAsp.Net?18