views:

155

answers:

5

The primary reason for asking how to do this is because I personally never use it. The Designer is slow to load... especially on complex pages with lots of controls. To put it bluntly, I think of it as a crutch that web developers should avoid.

I would like to encourage team members to avoid using it as well. If there is a way to do this through a policy setting (either in TFS or otherwise) or some options when installing Visual Studio that would be even better.

A: 

It's a per-user setting, by right clicking on the .CS file for the form and saying "Open With...", then changing the default editor for that type.

AFAIK, there is no way to force that setting via TFS.

Brad Wilson
I think he was referring to the Web Designer?
Diago
A: 

There is no way to suppress the Editor directly, as it is part of Visual Studio. The Visual Studio 2008 is a much improved editor, as it is the same one used in Expression Web and I often use it. Also the source view is part of the Editor from what I remember.

There is an option in VS Settings to always open ASPX pages in Source View however:

  • Tools
  • Options
  • Web Browser
  • View source in

You can also specify an external editor. There is no way to suppress the designer using TFS or a GPO however.

Diago
+2  A: 

Go to

Tools Menu 
  -> Options 
    -> HTML Designer

The first groupbox is "Start pages in". Setting it to Source View should accomplish what you are looking for within VS.

blu
Thanks. I think you mean "Tools Menu" rather than "File Menu" right?
Saul Dolgin
Fixed "File" to "Tools".
Bob King
Oh yes, Tools not File, thanks for updating it.
blu
A: 

I think so. In the Solution Explorer, right-click the an aspx or ascx file and choose Open With. When you choose the editor you want you can set it as default.

Rob Windsor
+1  A: 

Thank you for all the helpful answers. What I ended up doing was setting the default view from Tools -> Options -> HTML Designer - Start Pages In = Source View (as suggested by @blu). Then I exported my Visual Studio settings to a file. The snippet below is an abstract of the relevant section. This can be saved as a .vssetings file and imported by team members as part of our standard setup:

<UserSettings>
    <ApplicationIdentity version="9.0"/>
    <ToolsOptions>
     <ToolsOptionsCategory name="TextEditor" RegisteredName="TextEditor">
      <ToolsOptionsSubCategory name="HTML Specific" RegisteredName="HTML Specific" PackageName="Visual Studio HTM Editor Package">
       <PropertyValue name="StartPageView">1</PropertyValue>
      </ToolsOptionsSubCategory>
     </ToolsOptionsCategory>
    </ToolsOptions>
</UserSettings>
Saul Dolgin
Perhaps you should accept blu's answer...
Chris Porter
Saul Dolgin
+1 Exporting and then importing this as a setting is cool stuff
blu