asp.net - What is the difference between "@Url.Content" and "@Href"? -


it seems stylesheets can referenced razoresque either way:

<link href="@url.content("~/content/jquery.duckbilledplatypus.css")" rel="stylesheet" type="text/css"  /> 

...or way:

<link href="@href("~/content/jquery.duckbilledplatypus.css")" rel="stylesheet" type="text/css"  /> 

is there advantage 1 way on other?

i noticed had this, too:

<script src="@url.content("http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js")" type="text/javascript" defer ></script> 

...which bogus (the razoresque-ization of href way), file on cdn doesn't need razorized.

both similar except url.content works applications's virtual directory. @href comes system.web.webpages library , @url.content part of mvc.

@url.content favorite.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -