Way to Avoid ASP.NET UpdateModel Magic Strings

Using the UpdateModel in an ASP.NET MVC or Web API controller allows for the specification of the fields of the model to bind data from the client to a model class in an application. The default is to try and bind all fields the of the model to a field in the client request. However, this can lead to problems.

ASP.Net URL Rewrite with Web API and AngularJS

Looking at many AngularJS samples you will see they are served using the following format.

https://somewhere.com/index.html#/routePart1/routePart2/someId

Having the index.html# always be part of the route is not very pleasing visually, but there is a way to end this and change the application URLs to lose reference to the index page.

Allowing clean URLs for an AngularJS app served by an IIS or IIS Express server is a several step process.

Note: for IIS, you must install the the Microsoft URL Rewrite Module 2.0 for IIS (x64) for IIS so that the rewrite rules specified in the web.config are recognized. Without this extension, IIS will throw the following error:

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.