title: Asp.net MVC 2 Production errors
body: <p>I have an MVC 2 application hosting on an IIS6 server. I have already done all the routing tweaks so that it can browse in the environment. The problem is however, that I have a dynamic partial view creation aspect, where a partial view is loaded each time an add button is clicked. Using Javascript and a controller, I call the partial vie and add it to a table each time. </p>
  
  <p>Javascript Code</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  $(function() {
      $("#btnAdd").click(function (e) {
          var itemIndex = $("#container input.iHidden").length;
          console.debug("itemIndex : "+itemIndex);
          e.preventDefault();
          var URL = "/WorkOrder/NewItem/" +itemIndex; 
          $.get(URL,function(data){
              $("#container").append(data);
          });           
      });
  });
  </code></pre>
  
  <p></p>
  
  <p>and the controller is</p>
  
  <pre><code>public ActionResult NewItem(int id)
      {
          var interest = new ItemModel { index = id };
          return View("_NewItem", interest);
      }
  </code></pre>
  
  <p>Quite simple really. The funny thing is that it works when in the test localhost environment, but as soon as i deploy it to production, the btnAdd function does nothing. After using the inspect element Network debugging tool, I discovered that the network is returning a 404 error for the partial view. </p>
  
  <p>Do i have to tweak the routing tables more to make them recognize the routing regime i am trying to implement?</p>