Sunday, 23 November 2008

Website Publishing Gotcha

I was trying to publish a web site in Visual Studio 2005 this week and kept coming across this strange error when browsing to the published website.

Cannot convert type 'ASP.login_aspx' to 'System.Web.UI.WebControls.Login'

After some pen chewing, head scratching and news group ferreting I came across the solution in this posting.

Apparently if you call an aspx page the same as a standard WebControl then the publishing freaks out. Which fool would do that? Well this fool does on a regular basis. I always call my log in pages Login.aspx – the same as the login control. The solution – a quick rename of the page to Default.aspx and stride manfully out of the office declaring that the website is now released into the wild. Job done (and will be done a bit quicker next time).

No comments: