How to configure Visual Studio (2010) to open aspx pages on code behind by default on double click? - visual-studio

The question says it all... its pretty simple, and it can be done by selecting the file and pressing F7 but I'm always double clicking accidentally and visual studio takes forever to open the design view page (even if its almost empty), but I just wanna go straight to the code.
Any tips?

I had this problem too. My solution was to change Visual Studio to open up pages in HTML view by default. Because VS doesn't need to format the page, this is MUCH quicker. You can see how to get Visual Studio to open pages in HTML view at http://www.wiseowl.co.uk/blog/s153/visual-studio-html-view.htm.
To tell Visual Studio 2010 to open files automatically in Source view,
Tools -> Options
Select the General section of the HTML Designer tab.
Choose to start pages in Source View.

Just incase Andy's link dies, the method to make Visual Studio open ASPX pages in HTML view rather than the default designer view:
Go to Tools -> Options. Select HTML Designer from the menu at left. Select "HTML View" for HTML pages, Active Server Pages and Web Form pages. Click OK.
This forces VS to open pages in HTML view, which for developers is usually the view we work in for editing ASPX templates. In addition, it addresses the original issue of this question, which is getting VS to open pages faster, since it doesn't have to render a designer view.

I think you are asking to configure VS2010 to take you to the .cs / .vb file when you double click on the aspx page, but you could also be asking about make it go to the html source view.
If you are wondering about the latter (html source view), here is a screenshot of what setting to change.
http://screencast.com/t/8UluCEUQr
I hope this helps.

Related

i can't find the design viewer option in my visual studio community

when I create a new project the first time I can see the Design viewer option, but when I close VS and reload the project the second time I can't see the design viewer anymore, I didn't find the solution please help!
When you open VS you may see the code page. If you want to see the designer view, click in the menu View and Designer. You can also use the shortcut SHIFT+F7. But first make sure, you opened the file in the project explorer.

How to show Design View in Visual Studio 2015?

I am using Visual Studio 2015.
In my C# class at school we are designing a Windows Form App. We started the project in class, and checked it into our TFS so I can use it at home. I loaded it at home and under the design tab it just shows the code view, not the design view, but whenever I press "Start" it opens up and shows everything and lets me use save stuff and reopen them in the listbox.
So at home I am unable to see the design so I can't add buttons, textboxs, etc.
How am I able to make it show the design view and not just the code view?
Try to highlight the [Formname].cs File in your solution explorer. Then press [Shift]+[F7]. This should do the Trick.

Open WinForm in Code view

I used Visual Studio 2013, It is easy to open design view or code view of a winform. Like this
But now I upgrade to VS 2015, I can only right click on winform then choose Code view or press F7 to switch from design to code view
Is there anyway to open code view as VS 2013 in VS2015?
Yes you can. Here is a screenshot of my VS15. If I rightclick on the highlighted line, it brings up the option to open either the code view or the design view. I tend to agree with Hans, I think your install may be damaged.

Is there a way to add url as a link to visual studio project

Is there a way of adding a URL to a Visual Studio Project or Solution such that when clicking on it the web page is brought up as a tabbed document within VS)?
(I wish to get a MantisBT web page up as a tab within Visual Studio and this seemed to be the best way of doing it).
If I create a link as a shortcut in the project folder, or create a link by dragging the page from IE to the folder, this file is opened as an XML file. Open with Browser opens it externally to VS.
If I open the .url I can then CTRL+Click on the url in the link and it will open the page as a tabbed item. Is there a way to do this in one step?
I think that in the play button you have a few options like page inspector, maybe you can try that? Ctrl+Shift+W is the shorcut

Visual Studio 2008 ASMX files

This is not technically a programming question but it does specifically relate to a heavily used programming tool so i think this is the correct place for it.
In Visual Studio 2008 if i have an asmx web service and i double click on the asmx file it opens the asmx.cs file, this is eminently sensible seens as there is just a single line directive in the actual asmx file. However if i click on the asmx.cs file directly, it tries to open it in "design" mode, i.e. the mode for aspx files where it shows you a visual designer rather than the markup. The result is you either get a grey screen saying that this file type cannot be viewed in design mode or you just get a wierd visual studio exception handling page. All i'm doing is double clicking on the asmx.cs page. I can post screen shots if anyone is interested. I have observed this behaviour on my coleagues machines as well so it does not seem to be some wierd quirk on my particular install. Has anyone observed this behaviour? can anyone reproduce it? Is it a bug? Is there a service pack that fixes it? Is it some wierd setting i have been unable to locate. It is not a show stopper becuase double clicking the asmx file opens the relevent code file but I would like to fix it if possible.
The .asmx file is essentially a markup file that points to a code-behind file. Since the markup is never changed, the (pre-VS2008) VS developers thought it was a good idea to display a warning screen instead.
To avoid this warning screen, you can right-click the .asmx file, select Open with... and set the Source Code (Text) editor Editor to be the default. In VS2008 and VS2010, the code-behind will display when you double-click the .asmx file in the future.
If you want to view and/or edit the markup of the .asmx file, simply right-click the .asmx file and choose 'View markup'. Not sure if this works in VS2008 (don't have it here), but it works in VS2010.

Resources