santose
santose

Reputation: 21

url.content in asp.net

url.content in MVC

What can I use same like that for ASP.NET web forms?

Upvotes: 2

Views: 2523

Answers (2)

Mardok
Mardok

Reputation: 664

Use runat="server" like:

<a href="~/<your path>" runat="server">url.content sample</a>

Upvotes: 1

Kurt S
Kurt S

Reputation: 21357

If you are asking for a method that accepts a relative path and generates a URL for ASP.NET web forms, see Page.ResolveUrl or Page.ResolveClientUrl. ResolveUrl returns a path relative to the site root, whereas ResolveClientUrl returns a path relative to the current page.

Upvotes: 4

Related Questions