views:

256

answers:

1

I have an asp.net website (SQL Server, Windows 2003, IIS 6) and I am using google.com/analytics/ to track visits. It all works fine.

Now I would like to use Google Webmaster to get better information about my site but when I try to verify it by uploading a html file I get this error:

"We've detected that your 404 (file not found) error page returns a status of 200 (Success) in the header."

Any ideas - how to fix this?

+1  A: 

Set the StatusCode of the Response object manually. Put something like this in your 404 page's code behind:

protected override void Render(HtmlTextWriter writer)
{
    base.Render(writer);
    Response.StatusCode = 404;
}
Colin Mackay
Do you have any idea how?
asperous.us
Updated with some code
Colin Mackay
By any chance does it also let you verify the site through a meta tag? If so, you might do that instead.
Otis