Automate update of web.config with Microsoft Powershell

I have an ASP.NET web site project that I use for 5-10 web sites. Each has its own directory, setup in IIS and MySQL database, ie they work as independent web sites, only the code base is the same. For updates I have a setup with one Windows command file to copy out any file… Continue reading Automate update of web.config with Microsoft Powershell

.NET Client Side Field Validation not working

This was driving me nuts earlier today, so this post is a kind of reminder to myself not to forget this again: When using Routing in .NET 4 always remember to add exceptions for axd files! Example: [code]routes.Ignore("{resource}.axd/{*pathInfo}")[/code] In my case I could not get standard .Net Field Validation to work client side. It was… Continue reading .NET Client Side Field Validation not working

How to remove characters to avoid .NET Request Validation Error (A potentially dangerous Request.Path value was detected from the client)

In .NET Framework 4 url checking – request validation – is different from .Net 2.0. This is the error you will see when you hit this: Server Error in ‘/’ Application. A potentially dangerous Request.Path value was detected from the client Description: An unhandled exception occurred during the execution of the current web request. Please… Continue reading How to remove characters to avoid .NET Request Validation Error (A potentially dangerous Request.Path value was detected from the client)

ASP.NET 4.0 Chart Control Problems on IIS7

I have been playing around with the ASP.NET 4.0 Chart Controls for a new web site (Bilvärdet.se – used car price statistics) When deploying it to IIS7 on my Windows Server 2008 I ran in to a few problems: 1) I did not have .NET 4.0 Framework installed on the server 🙂 It turns out… Continue reading ASP.NET 4.0 Chart Control Problems on IIS7

MySQL and Visual Studio 2010 Membership, Roles and User Profile Provider

In Visual Studio 2010 (VS2010) when you create a new Web Application Project using the default Web Template “ASP.NET Web Application” it creates an Account folder with the files Login.aspx, Register.aspx and ChangePassword.aspx. These are files/pages for ASP.NET Membership which is ASP.NET’s built-in user handling. I have never used Membership before but have been curious… Continue reading MySQL and Visual Studio 2010 Membership, Roles and User Profile Provider

MySql.Data.MySqlClient.MySqlException: Parameter ‘@id’ must be defined

I found out a funny thing today. Or maybe not so funny when I think about it… The order page on one of my sites have not been working since early November, almost 6 months!! As I’m sure you understand it’s not a very busy site, but usually I get a few orders per month… Continue reading MySql.Data.MySqlClient.MySqlException: Parameter ‘@id’ must be defined

BC30560: ‘MySqlConnection’ is ambiguous in the namespace ‘MySql.Data.MySqlClient’.

I got this error in one of my ASP.NET web sites after uploading a new version: BC30560: ‘MySqlConnection’ is ambiguous in the namespace ‘MySql.Data.MySqlClient’. It worked fine on my development machine but not on the production server. I could not figure out what it was for quite some time. Turned out I had added the… Continue reading BC30560: ‘MySqlConnection’ is ambiguous in the namespace ‘MySql.Data.MySqlClient’.