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:

  1. <script src="../../scripts/jquery-1.4.4.min.js" type="text/javascript"> </script>

  2. <img src="../../content/images/logout.png"/>

  3. <div class="menu_home" style="background-image:url('../../content/images/menu_home.png');background-color:#919191;"></div>

  4. $.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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -