The ASPX Edit Helper is an add-in for Visual Studio 2005 for those who like to type ASPX markup themselves instead of using the visual designer. It’s a very simple add-in but pretty handy if you prefer to type ASPX. (It also works with Visual Studio 2008.)
ASPX Edit Helper does just two things:
- Fill in runat=”server” id=”random_id” when you type a server control (e.g., asp:Label).
- Insert ASPX snippets when you type a short code.
Usage Type 1
Type <asp:Label and press Enter. The add-in will replace it with:
<asp:Label runat=”server” id=”asp_Label2943″ />
The add-in will also highlight the ID attribute value so you can immediately type a new ID for the control.
Alternatively, type <asp:Label></asp:Label> and press the Up or Down arrow.
Usage Type 2
Type a short code such as /lbl or /txt and press Enter. The add-in will replace it with the corresponding ASPX snippet:
<asp:Label runat=”server” id=”asp_Label2943″ />
<asp:TextBox runat=”server” id=”asp_TextBox2943″ />
The short codes and snippets are defined in the AspxEditHelperSnippets.xml file which you can crack open and modify as needed. The format for a short code must be a slash (/) followed by one or more regex word characters (\w+).
Video
You can see a brief intro video on ASPX Edit Helper at http://ardentdev.com/aspxedithelperfiles/aspxedithelper.html.
Installation
Copy the three files AspxEditHelper.AddIn, AspxEditHelper.dll, and AspxEditHelperSnippets.xml to your Visual Studio add-ins folder:
%userprofile%\Documents\Visual Studio 2005\Addins
or
%userprofile%\Documents\Visual Studio 2008\Addins
Downloads



August 7th, 2007 at 3:34 pm
Hey Derek, very handy little add-in!!!
August 8th, 2007 at 11:02 am
Hello,
%userprofile%\Documents\Visual Studio 2008\Addins does not exist for VS 2008.
Where should i place the files so that addin works in VS 2008 as well?
August 8th, 2007 at 11:15 am
Nice work! I’m curious why picked enter over tab for completing commands. Wouldn’t using tab be more consistent with the built-in VS code snippets?
August 8th, 2007 at 3:21 pm
Awesome! I wanted something like this for a long time.
Is it possible to make it trigger on “space”? For example: if type “
August 8th, 2007 at 3:58 pm
@Dragos: Just create the Addins folder if it’s not there.
@John S, @Peter: I wanted to trigger off space or tab but I didn’t find a way to do that with an add-in. The only event I could find was for LineChanged. This was my first VS add-in so if anyone knows a better way to hook changes events in the editor, please let me know!
December 7th, 2007 at 11:12 pm
Fun add-in.
Please remove the runat/id auto-complete on ListItem’s.
Thanks!
January 18th, 2008 at 7:00 pm
Very nice addin! I also had the problem with the ListItems, so I added the snippet below to AspxEditHelperSnippets.xml. Now I type “/li” and hit Enter for a listitem. I used the $id$ marker to position the cursor for editing.
li
]]>
January 18th, 2008 at 7:08 pm
Trying again, hopefully with proper html formatting this time.
<snippet>
<shortcode>li</shortcode>
<text><![CDATA[<asp:ListItem Text="$id$" Value=""></asp:ListItem>]]></text>
</snippet>
February 10th, 2008 at 9:50 am
Thanks Derek.
VS 2008 Addins folder is:
%ALLUSERSPROFILE%\Application Data\Microsoft\MSEnvShared\AddIns
Best regards
Anoosheh
March 6th, 2008 at 10:51 am
What a great tool :)=
Are you able to extend the addin to support adding eventhandler to server controls while in Visual Studio source view of as?c files?
I really hate to switch to design view, hightlight the control to get its properties and to select the lightning bolt from the property window… finally there i can double click to create the eventhandler. that is far too complicated.
Thanks, toebens
March 8th, 2008 at 12:45 am
toebens – you can bring up the properties window (F4) while is markup view to access events that way.
April 1st, 2008 at 11:59 am
Derek,
Very cool! Plus I love the “Not Beta” emblem on your website.
Mostafa’s comment about the location of the AddIns folder for VS2008 is correct – you might want to think about updating your instructions at the top of this page. Before I saw Mostafa’s comment I created an /AddIns folder under %userprofile%\Documents\Visual Studio 2008 and this triggered the GhostDoc configuration routine to run again next time I started VS2008.
Also, I opened up the source code and modified the way the GenerateAspxElement function creates its return value. For what it’s worth, here’s the updated code block:
If includeClosingTag = True Then
retVal = String.Format(“”, tagName, controlID, tagName)
Else
retVal = String.Format(“”, tagName, controlID)
End If
With this mod, if I don’t want a closing tag I can type (for example): “” or “” and hit the Enter key and ASPX Edit Helper generates: “”. If I DO want a closing tag I can leave off the closing angle bracket and just type (for example): “”
April 1st, 2008 at 12:05 pm
Hmmm… let me try that again with some HTML encoding.
Here’s the modified code block in the GenerateAspxElement function:
If includeClosingTag = True Then
retVal = String.Format("<{0} runat=""server"" id=""{1}""></{2}>",
tagName, controlID, tagName)
Else
retVal = String.Format("<{0} runat=""server"" id=""{1}""/>",
tagName, controlID)
End If
With this mod, if I don’t want a closing tag I can type (for example): "<asp:Checkbox/>" or "<asp:Checkbox>" and
hit the Enter key and ASPX Edit Helper generates: "<asp:CheckBox runat="server" id="asp_CheckBox6368"/>".
If I DO want a closing tag I can leave off the closing angle bracket and just type (for example): "<asp:DropDownList" and hit Enter and ASPX Edit Helper generates: "<asp:DropDownList runat="server" id="asp_DropDownList1946"/></asp:DropDownList>"
May 23rd, 2008 at 12:03 pm
I keep getting the following error every time I try to get it to run in VS2008. I tried placing the files here to no avail (VS will not even recognize it – even though DevExpress dll is also there and it works):
C:\Documents and Settings\All Users\Application Data\Microsoft\MSEnvShared\Addins
I then tried creating the folder (Addins) as above (\Visual Studio 2008\Addins), then this happens (error).
—————————
Microsoft Visual Studio
—————————
The Add-in ‘ASPX Edit Helper’ failed to load or caused an exception.
Would you like to remove this Add-in?
If you choose yes, the file it was loaded from, ‘H:\Visual Studio 2008\Addins\AspxEditHelper.AddIn’, will be renamed.
Error Message:
Error number: 8013150a
—————————
Any ideas why this could be?
Mozes
May 23rd, 2008 at 12:06 pm
Ok, I think I see what is going on. My Documents folder is mapped to a remote drive. When I reset things to the local drive, it works. Is there any support for a mapped drive (company policy)?
June 11th, 2008 at 5:30 am
Mozes,
I faced the same problem with another addin. Try copying the .addin file and the dll in the folder C:\Documents and Settings\All Users\Application Data\Microsoft\MSEnvShared\Addins, it worked for me. The Application Data folder is hidden.
June 17th, 2008 at 7:15 am
Wow – what a nice tool. If only clients knew how much money you’ve just saved them on a per-hour project!
Thanks Derek.
June 19th, 2008 at 4:34 pm
Thank you so much. This tool is wonderful.
And thank you for the source code, Now I can add as many of these that I want.
August 27th, 2008 at 10:50 am
Hi, this looks very useful, thanks!
I have a question for which I’ve not found an answer absolutely anywhere: at some point something in my VS2005 changed so that, whenever I double-click on an ASPX file in the Solution Explorer, it always opens the page in design view instead of HTML markup edit view. Like you, I much prefer working with the markup directly.
Any idea how to change this setting??
Sorry for the off-topic post but the people here sound like precisely the ones who’d be able to help me out ;-)
Tian
August 29th, 2008 at 8:34 am
In answer to my own question: I found the solution and if you don’t mind I’ll document it here for those other lost souls to find via the big G…
In VS2005 Solution Explorer, right-click on any .aspx file, choose “Open with…” In the dialog, tick “Source (Text) Editor”, tick “Set as default”, click “OK”.
You’re in business – no more poxy design view.
November 3rd, 2008 at 5:28 pm
Thank you so much for this. I cannot afford CodeRush and have been looking for this forever.
February 20th, 2009 at 3:08 pm
I’m having trouble getting the plugin to work in VS2008. I’ve added the add-in to C:\Documents and Settings\All Users\Application Data\Microsoft\MSEnvShared\Addins as suggested above. The add-in shows up in the Add-in Manager, but doesn’t seem to work. Any ideas?
February 20th, 2009 at 11:18 pm
ok, i got it to work…simply needed to press “enter”. sorry for not reading the instructions thoroughly enough.
May 5th, 2009 at 4:35 am
Downloading right now! So curious. I love typing aspx markup !
July 4th, 2009 at 10:22 pm
Thanks for this simple program. Using the line changed event is actually a good idea because it’s less taxing on the IDE.
I made the following modification to the program:
– Any character can now be use as a short cut for snippet.
– For snippet that doesn’t have an ID, an $$ sign can now be use in CDATA to position the cursor in a more convenient place.
Please contact me if you want the update source. I couldn’t find a contact form on your blog.
July 27th, 2009 at 4:22 pm
toebens – you can bring up the properties window (F4) while is markup view to access events that way.
October 9th, 2009 at 5:51 am
INFO: Default .AddIn file locations for Visual Studio add-ins
http://www.mztools.com/articles/2008/MZ2008001.aspx
October 23rd, 2009 at 4:33 pm
Beautiful, thank you!! No problem getting it working in VS2008, put it in the spot Mostafa mentioned.
April 16th, 2010 at 12:20 pm
Has this been tested on VS2010?
April 16th, 2010 at 2:16 pm
[...] of my favourite Visual Studio helper add-ins is ASPX Edit Helper Add-In For Visual Studio. It’s a great helper that saves loads of typing time when writing ASP.NET pages in Visual [...]
April 16th, 2010 at 2:19 pm
–BAD NEWS–
It doesn’t work with VS 2010:(
–GOOD NEWS–
I’ve ported it over and have a version that works with VS 2010.
http://www.rowlandoconnor.com/2010/04/16/aspx-edit-add-in-for-visual-studio-2010/
Binaries and source available.
April 18th, 2010 at 5:37 pm
Thanks for porting this over to VS2010 :)
June 26th, 2010 at 4:40 am
I’m running the free express version of Visual Web Developer, and I can’t seem to get the ASPX edit helper to work. I’ve copied it to the Addins folder of visual studio 2008, but nothing happens. has anybody any thoughts on this please?
July 6th, 2010 at 3:39 pm
@George Unfortunately the Express versions do not support addins
October 13th, 2010 at 6:36 am
Thanks for this add-in !
May 18th, 2011 at 6:50 am
Really a nice initiative, i have tried it and found it very useful. Thanks for this add in :)
August 18th, 2011 at 3:47 am
Hi, Neat post. There is a problem with your website in internet explorer, would test this… IE still is the market leader and a large portion of people will miss your magnificent writing due to this problem.
August 26th, 2011 at 3:35 am
This truly is an amazing post! Could you please write something more about it? I learned a lot new from here and be going to check the blog often. All the best!
September 14th, 2011 at 2:53 pm
Rattling wonderful info can be found on blog .
June 1st, 2012 at 4:11 am
There are lots of appliances in our domiciles that need a great deal of energy and capacity to obtain job done correctly. The utilization of these appliances could be crucial to saving our very own time and effort so we do not want to eliminate these appliances to save money. Oftentimes nowadays there are models that use less energy and therefore are a lot more efficient with regards to using over and over through the week.
Dishwashers will always be looked at as an extravagance, or the ��lazy man’s option’ since it was previously the case that few house holds had one. Nowadays though they have been nearly as common as refrigerators and automatic washers in many UK household kitchens. Utilizing a dishwasher takes a large amount of energy and water and thus you can easily understand why they’d earned their poor efficiency rating.
Just like many appliances the brand new developments in manufacturing and operations means that they’ll be more efficient, using less power and less water. A sizable element of making appliances more energy conserving isn’t the particular product however the way we utilize it alternatively. The way in which we use our appliances must be efficient as even probably the most economical models available on the market may become wasteful in the event that you only utilize them to clean a tiny bit of items.
Dishwashers are like automatic washers for the reason that they use lots of water and energy to wash what it expects to become a full load of laundry or dishes. If you’re only loading a couple of items any time you make use of the appliance then you will quickly find that you will be spending more in your electricity and water bills and needing to stock up the equipment often.
If your household has a lot more than two adults residing in after that it there is a good chance that the smaller dishwasher won’t be most useful for you personally, smaller washers can use less water and also have energy conservation benefits for people or couples but larger family groups may have scores of dirty dishes after only one meal and thus you will need to obtain a larger model that may wash a sizable load at the same time, helping you save money on multiple wash cycles.
Judging the needs you have as it pertains time for you to purchasing a dishwasher is essential as it can certainly directly affect your time bills. You will find other buying considerations to note like the selection of cycles which could handle pots or special eco settings that use less water.
Dishwashers aren’t the only real kind of appliance that you could get energy conserving or green versions of, there’s also automatic washers also.
Resource: How You Can Find an Energy Efficient Dishwasher
October 25th, 2012 at 11:45 pm
I used to be able to find good advice from your
blog articles.