software, productivity & more
Archive for December, 2009
Redirecting .asp to aspx in ASP.Net MVC
Dec 27th
I am learning ASP.Net MVC and I am loving it.
In the process of migrating our existing classic asp website to ASP.Net MVC we realized that we would still need an .asp file as part of the web app. It’s the redirect.asp file that all our products call to go to different parts of our website.
Fortunately, ASP.Net MVC provides a neat way to do this without actually creating an .asp file. You can route the .asp call to .aspx (MVC View) and have all your code in ASP.Net MVC controller.
Go to Global.asax.cs and write the following code:
routes.MapRoute("Redirect", "redirect.asp", new { controller = "Home", action = "Redirect" });
That’s it.
Note that the redirect.asp file should not (and does not) exist. The routing engine would just route the call to an action that you specify.
Thanks.
‘MySqlConnection’ is ambiguous in the namespace ‘MySql.Data.MySqlClient’
Dec 4th
Thanks to Steve Huff who blogged about a solution to the above problem.
If you are planning to use MySql .Net Connector in ASP.Net, you may get the above error if MySql.Data.CF.dll is installed in both GAC and Bin folder. So you need to delete it from Bin folder to fix the problem.
You need to keep the following files intact inside the Bin folder:
MySql.Data.dll
MySql.Data.Entity.dll
MySql.Web.dll
MySql.VisualStudio.dll
Thanks.