Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't find options for Select Master Page or Place code in separate file in VS2012

I installed VS 2012 on my work PC, and for the life of me when I go to add a new web form, I cannot see or find the 2 options for Select Master Page or Place code in separate file.

Any ideas on how i can find them?

like image 671
Cwm Avatar asked Sep 19 '13 20:09

Cwm


2 Answers

I've just been fooled by just that for the past hour. What I've found is that the 'old' method of using the menu option 'Add web page using master' (or similar) has vanished, and been replaced by 'Content Page'. When you select this, you're then given the option of choosing a master page.

Incidentally, I don't get the option of starting a web site project, which may be why I'm not seeing this either.

like image 54
George Williams Avatar answered Sep 23 '22 09:09

George Williams


You should have web form with master page in the add items?

Placing code in separate file is a different concept called code-behind. You will have an ASPX file and a cs / vb file which handles the events.

e.g.

Default.aspx
Default.aspx.cs

enter image description here

EDIT: Based on comment.

You may be using a Web Site on your laptop, but a Web Application in work. See Web Application Projects v's Web Site Projects.

Take a look at ASP.NET Web Site or ASP.NET Web Application?, this might also help in deciding which to use. Generally, I always go for Web Application.

You can use VS to convert from a Web Site to a Web Application, but AFAIK, you can't do it the other way round unless you create a new project and copy across the relevant parts - which could be a big job depending on the size of the site.

like image 20
Christian Phillips Avatar answered Sep 21 '22 09:09

Christian Phillips