Cheap web hosting and email trouble

We've been having some troubles with our email, last week. Our contact form didn't work. Please try again if you contacted us and did not get any reply

This is due to that our web hosting company, Scanhost.co.uk, has been having some troubles with the upgrade of the mail servers. Only the English domain of ours has been affected, and is still not working.

But I'm sure they fix this soon. If you're looking for a cheap web host with good support I can highly recommend Scanhost.co.uk.

By Jesper Lind

Troubleshooting: A potentially dangerous Request.Form value was detected from the client

This is an error which is caused by posting html-code in a textbox. The text doesn't need to contain valid HTML, just anything with opening and closing angled brackets ("<...>").

The complete error:

Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (ctl00$mainContentPH$fvFaq$tbFaqBody_sv-SE="...the link <a href="http://www....").

Solution
There are two ways to disable request validation.

1. Turn it off in the Web.config file

<system.web>
<pages ValidateRequest="false"/>
</system.web>

2. Turn it off on the page it self

<%@ Page ValidateRequest="false" ... %>

A warning for injection
The validation is there for a reason. If you turn it off, visitors can post code like this, and that's not wanted in most cases.

alert('I am posting some dangerous code')

More info on the web site of Brian Cryer.

By Jesper Lind

Procedure ... expects parameter ... which was not supplied : ADO.NET Error

I had some problems with figuring out the cause about this error.

Procedure <procedure name> expects parameter <parameter name>, which was not supplied : ADO.NET Error

At last I found the solution on Data Mining Developers.

Example of the problem

string ColumnName = null;
//error will be thrown if the variabe ColumnName is null
if(ColumnName ==null)
ColumnName=string.Empty;
SqlParameter param = new SqlParameter("@ColumnName", SqlDbType.NVarChar, 100);
param.Value = ColumnName;
cmd.Parameters.Add(param);
cmd.Execute();

By Jesper Lind
1