5

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?

arserbin3
  • 6,010
  • 8
  • 36
  • 52
Cwm
  • 93
  • 2
  • 6

2 Answers2

9

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.

George Williams
  • 147
  • 1
  • 10
3

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.

Community
  • 1
  • 1
Christian Phillips
  • 18,399
  • 8
  • 53
  • 82
  • I have that, web form with master page, but on my laptop (which has vs2012) gives me all those items and gives me the two options, and i was trying to understand why its not working like that on my work pc – Cwm Sep 19 '13 at 20:12
  • ohhh, ok. I see what you are saying. Is there a way i convert it to a website? Everytime i go to create an app i always use Visual C#>Web>Asp.Net Empty web application. I do that as well on my laptop. – Cwm Sep 19 '13 at 20:19
  • @Cwm, NP - I just added a part about the conversion. – Christian Phillips Sep 19 '13 at 20:36