Writer and Programmer

In VS2008, I created a new file but it had no code-behind. Chose ‘File – New File – Web Form’. Several times. Tried loads of stuff. No code-behind – the aspx top line was: <%@ Page Language=”VB” %>.

I was thrown because I haven’t used VS2008 for ages. I’d only just installed it and a trawl of Google threw up all kinds of suggestion such as a VS reinstall.

Which wasn’t needed. It turns out you have to add the file via the Solution Explorer to get the code-behind. As in, right-click on the project and choose ‘Add – New Item’.

I stumbled across this while experimenting. Having no code-behind in files added from the File menu is probably a ‘feature’, and so well-known that no-one has bothered documenting it anywhere. Which is why I’ve mentioned it here – hope this helps someone.

 

Leave a Reply

Your email address will not be published.

Ita Ryan

Shopping Cart

Loading...

Newsletter

I only send out an email when I publish something new, have a big event coming up, or publish in a new format. So if you sign up to my mailing list you might get one or two mails close together occasionally, but then nothing for months.

I take my readers' privacy very seriously, and will never pass on your email address - Ita