Probably you, as I did, wondering why 'Convert to Web Application' option is available only on Web Application project.
In first thought: there is no sense to convert Web Application to Web Application.
I have tried couple of times to use that on an existing Web Site, but with no luck at all.
"This is totally useless" - I thought to myself.
Then recently I found how it can be used and it appears to me reasonable to have that option on an Web Application. Maybe the name is not very helpful and push your thoughts in different direction, but nothing is perfect.
However, here is the case I used that.
Recently, I have started to spend some time on updating my personal web site http://artembg.com
Mostly because I want to make it more useful and be able to add some other stuff there, not just projects.
Originally I have used Web Site project, but now I decided to go for Web Application and adding support the "top of the pop" ASP.NET MVC in same context as my good old existing WebForms.
So, I have created a Web Application project and moved my existing WebForms to the new Web Application project.
When I tried to compile the project I got a lot of errors. Errors which at first surprise me a lot.
In the code-behind were missing all the server-side controls references using on the WebForms.
For example:
Error 49 The name '_txtEmail' does not exist in the current context
Then I found what's wrong - I was missing all the *.designer.cs files for all the WebForms I have moved to the new Web Application. Where actually all server-side controls are defined for WebForms in a Web Application.
Looking around for some time and thinking what I can do, my attention was grabbed by 'Convert to Web Application' item in the context menu. I used it and here it was, magic happens I got my *.designer.cs file generated for the WebForm and errors gone.
That's it. I found what and when to use that for and that made my day.
So, if you have same problem I hope with this post to make your day too :)
Check out the short sample video here.
Happy coding ...
Posted
12-19-2008 9:47
by
velio