asp.net - how to config or handle iis when my website change its directory -
when developed , deployed asp.net mvc application in past,my code this:
<script src="../../scripts/jquery-1.4.4.min.js" type="text/javascript"> </script>
<img src="../../content/images/logout.png"/>
<div class="menu_home" style="background-image:url('../../content/images/menu_home.png');background-color:#919191;"></div>
$.ajax({ type: "get", url: "/home/details", data: { id: id }, success: function (jsonresult) {//something}});
there no problem while testing locally casini or deploy website in iis root directory.
now when add application in iis root, move application new application,i have rewrite code forexample in 3:
`<img src="url.content("~/content/images/logout.png")" /> `
in 4
$.ajax({ type: "get", url: "myweb/home/details", data: { id: id }, success: function (jsonresult) {//something}});
is there easy way this?forexample:config or handle in iis? iis version 7.5
you should define url in url
property this:
url: '@url.action(<action name>, <controller name>)'
in case url this:
url: '@url.action("details", "home")'
Comments
Post a Comment