How to Edit a Single File in WebMatrix

When using WebMatrix, you usually edit files within a website. However, you can use WebMatrix to edit files on your file system that are not part of any site. This can be useful if you want to make quick edits to a file, or work with files that aren’t used as part of an existing site. This tutorial shows a number of ways to do this with WebMatrix.

Editing an external file from within WebMatrix

If you have an existing site open in WebMatrix, you can edit files outside of the site if you are the WebMatrix Files workspace. To open the Files workspace, click the Files tab in the lower left corner of the WebMatrix window. Then, in the ribbon, click the Open button:


Tip: You can also use the keyboard shortcut CTRL-O.

This will open a file browser dialog that allows you to navigate to the file you want to open. In the Open File dialog, double click the file that you will edit in WebMatrix:


That’s it! Your file is now open for you to edit. Note that since it is not part of your site, it will not appear in the file tree in WebMatrix. When you save the file, WebMatrix saves it to the location that you opened it from.

Another way to edit a file is to drag it from Windows Explorer directly into the editor:



Editing an external file from Windows Explorer

In addition to opening files from within WebMatrix, you can also open files directly from the file explorer in Windows. Using Windows Explorer, browse to the file you want to open. Then, if WebMatrix is the only application in Windows set to edit your file type, double clicking the file will open it in WebMatrix.

If a different program has already been set as the default in Windows for the type of file you want to open, you can still use WebMatrix from Explorer. Right click the file, and then choose Open With. WebMatrix will appear in the shortcut menu for any file that it can edit:


You can discuss this article using the adjacent Facebook talkback.

For technical questions please visit our discussion forums, where we have a vibrant community of developers like you, as well as Microsoft engineers who are ready to answer your questions!