wayne on March 4, 2008
When you develop a web application it is sometimes necessary to also develop an administration interface of some type. While there are plenty of code generating applications that will design and build out the an entire administration interface, I usually prefer to design them myself. Not only do I not own an application that would do something like that, I prefer to stay close to the application by developing it myself. Also, most cost more than I'm willing to spend and then you also have to learn their way of doing things both on the front-end interface, as well as the code it generates. I don't know about you, but I haven't had the luxury of time to be able to venture into one of these tools.
While building out several data entry forms for an application I am currently working on, I thought it would be nice to be able to store the HTML table that I have been copy-pasting from one page to the next. Since I am re-using the same table over and over again, I wanted to be able to store the HTML somewhere to be able to quickly re-use it on new pages. What I found was a very quick way to accomplish this that I feel all Visual Studio users should use or at least be aware of. Here is how you can use the toolbox to decrease your development time a bit.
To help explain this, I'll be using a bit of HTML code that I am currently using to describe the shell of a data entry form. The following graphic shows what my data entry shell looks like. It contains a sample header item, a label for a data entry item, a textbox for data entry and some help text underneath. There are plenty of rows, etcetera.
Of course, this can really be anything you want, HTML, some code snippet, graphical elements, whatever you can copy.
That is the idea, anything you can copy can be placed into the toolbox. I prefer to use the toolbox's General tab for items like this, but you can create a new tab, or reuse any of the existing tabs if you prefer.
Simply copy the HTML that describes the bit of HTML you want to reuse and them paste it into the General tab area. You can also drag and drop the table in the Design View window to the toolbox to get the same results.
Since I'm using a table, I simply click inside the table and click the table selector (
) icon and drag it onto the toolbox. The image shows two items, the first one named Markup Fragment is the default name given to the item. The second shows that you can give it a more friendly name.
That's it! Pretty simple huh? Now, all I need to do when I have a new form that will be performing data entry is simply go to my General tab in Visual Studio and drag it onto a page.
Give some feedback! There are many other uses for this method of speeding up your development time. Like I said at the beginning of this post, this is the first time I've actually used the toolbox in this manner, and I have yet to see any posts on this. Is this new to you? If not, how are you using the toolbox to speed your development time? What other nifty uses have you used your toolbox for?