<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Frederik Vig - ASP.NET developer &#187; Visual Studio</title>
	<atom:link href="http://www.frederikvig.com/category/visual-studio/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.frederikvig.com</link>
	<description></description>
	<lastBuildDate>Wed, 28 Dec 2011 23:33:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Creating custom templates in Visual Studio</title>
		<link>http://www.frederikvig.com/2011/01/creating-custom-templates-in-visual-studio/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=creating-custom-templates-in-visual-studio</link>
		<comments>http://www.frederikvig.com/2011/01/creating-custom-templates-in-visual-studio/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 16:40:37 +0000</pubDate>
		<dc:creator>Frederik Vig</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.frederikvig.com/?p=1468</guid>
		<description><![CDATA[One abit hidden featured in Visual Studio is the custom item templates and projects feature. This allows you to easily export a project or item as a template, which you then can easily reuse across different projects, and even share between your collegues and team mates. This makes it very easy to create templates for ...]]></description>
			<content:encoded><![CDATA[<p>One abit hidden featured in Visual Studio is the custom item templates and projects feature. This allows you to easily export a project or item as a template, which you then can easily reuse across different projects, and even share between your collegues and team mates. This makes it very easy to create templates for your projects that follow the best practices you and your team mates have agreed on.</p>
<p>At <a href="http://geta.no">Geta</a> we have a set of guidelines and best practices that we follow in our projects. For instance we turn off ViewState and EventWireUp. The reason for turning off EventWireup is because of performance. When it&#8217;s turned on (default), ASP.NET uses reflection to look for special methods like Page_Load. What we do instead is override the OnLoad method. We also inherit from base classes and use master pages. Our user controls and web forms usually look something like this:</p>
<div class="wp_syntax">
<div class="code">
<pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&lt;%</span>@ PageLanguage<span style="color: #008000;">=</span><span style="color: #666666;">&quot;C#&quot;</span> MasterPageFile<span style="color: #008000;">=</span><span style="color: #666666;">&quot;~/Templates/MasterPages/Site.Master&quot;</span> AutoEventWireup<span style="color: #008000;">=</span><span style="color: #666666;">&quot;false&quot;</span> EnableViewState<span style="color: #008000;">=</span><span style="color: #666666;">&quot;false&quot;</span> CodeBehind<span style="color: #008000;">=</span><span style="color: #666666;">&quot;WebForm1.aspx.cs&quot;</span> Inherits<span style="color: #008000;">=</span><span style="color: #666666;">&quot;Web.WebForm1&quot;</span> <span style="color: #008000;">%&gt;</span>
&nbsp;
<span style="color: #008000;">&lt;</span>asp<span style="color: #008000;">:</span>Content runat<span style="color: #008000;">=</span><span style="color: #666666;">&quot;server&quot;</span> ContentPlaceHolderID<span style="color: #008000;">=</span><span style="color: #666666;">&quot;ContentRegion&quot;</span><span style="color: #008000;">&gt;</span>
&nbsp;
<span style="color: #008000;">&lt;/</span>asp<span style="color: #008000;">:</span>Content<span style="color: #008000;">&gt;</span></pre>
</div>
</div>
<div class="wp_syntax">
<div class="code">
<pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Collections.Generic</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Linq</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web.UI</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web.UI.WebControls</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">PageTypes</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">Web.Templates.Base</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">namespace</span> Web
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">partial</span> <span style="color: #6666cc; font-weight: bold;">class</span> WebForm1 <span style="color: #008000;">:</span> TemplatePageBase<span style="color: #008000;">&lt;</span>BasePageData<span style="color: #008000;">&gt;</span>
    <span style="color: #008000;">&#123;</span>
&nbsp;
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre>
</div>
</div>
<div class="wp_syntax">
<div class="code">
<pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&lt;%</span>@ Control Language<span style="color: #008000;">=</span><span style="color: #666666;">&quot;C#&quot;</span> AutoEventWireup<span style="color: #008000;">=</span><span style="color: #666666;">&quot;false&quot;</span> EnableViewState<span style="color: #008000;">=</span><span style="color: #666666;">&quot;false&quot;</span> CodeBehind<span style="color: #008000;">=</span><span style="color: #666666;">&quot;WebUserControl1.ascx.cs&quot;</span> Inherits<span style="color: #008000;">=</span><span style="color: #666666;">&quot;Web.WebUserControl1&quot;</span> <span style="color: #008000;">%&gt;</span></pre>
</div>
</div>
<div class="wp_syntax">
<div class="code">
<pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Collections.Generic</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Linq</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web.UI</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web.UI.WebControls</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">PageTypes</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">Web.Templates.Base</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">namespace</span> Web
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">partial</span> <span style="color: #6666cc; font-weight: bold;">class</span> WebUserControl1 <span style="color: #008000;">:</span> UserControlBase<span style="color: #008000;">&lt;</span>BasePageData<span style="color: #008000;">&gt;</span>
    <span style="color: #008000;">&#123;</span>
&nbsp;
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre>
</div>
</div>
<p>To convert this item to a item template go to File -> Export Template. Choose Item template and select the web form and user control, click next and give it a name and description. </p>
<p>
<img src="http://www.frederikvig.com/wp-content/uploads/export-template-wizard.png" alt="Export Template Wizard in Visual Studio" />
</p>
<p>When we now create a new item we can choose from our newly created item templates.</p>
<p>
<img src="http://www.frederikvig.com/wp-content/uploads/item-templates.png" alt="New item dialog in Visual Studio" />
</p>
<p><strong>Related Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.frederikvig.com/2009/10/creating-an-episerver-plugin/" rel="bookmark" title="October 8, 2009">Creating an EPiServer Plugin</a></li>
<li><a href="http://www.frederikvig.com/2009/12/part-7-creating-the-sitemap-page-create-an-episerver-site-from-scratch/" rel="bookmark" title="December 22, 2009">Part 7: Creating the Sitemap page – Create an EPiServer site from scratch</a></li>
<li><a href="http://www.frederikvig.com/2010/05/episerver-custom-property-with-custom-settings/" rel="bookmark" title="May 14, 2010">EPiServer Custom Property with Custom Settings</a></li>
<li><a href="http://www.frederikvig.com/2010/01/a-developers-guide-to-pagetypebuilder/" rel="bookmark" title="January 15, 2010">A developer&#8217;s guide to Page Type Builder</a></li>
<li><a href="http://www.frederikvig.com/2009/12/part-2-creating-a-foundation-create-an-episerver-site-from-scratch/" rel="bookmark" title="December 7, 2009">Part 2: Creating a foundation &#8211; Create an EPiServer site from scratch</a></li>
</ul>
<p><!-- Similar Posts took 26.398 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.frederikvig.com/2011/01/creating-custom-templates-in-visual-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2010 EPiServer Snippets</title>
		<link>http://www.frederikvig.com/2010/02/visual-studio-2010-episerver-snippets/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=visual-studio-2010-episerver-snippets</link>
		<comments>http://www.frederikvig.com/2010/02/visual-studio-2010-episerver-snippets/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 16:38:06 +0000</pubDate>
		<dc:creator>Frederik Vig</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.frederikvig.com/?p=1079</guid>
		<description><![CDATA[I finally got my hands on a copy of Visual Studio 2010 RC1! After playing around a bit, I stumbled across the new snippet functionality in Visual Studio 2010. You can now use snippets in the markup files as well (in previous versions you could only use the snippet functionality in code files like class/interfaces/code-behind ...]]></description>
			<content:encoded><![CDATA[<p>I finally got my hands on a copy of Visual Studio 2010 RC1! After playing around a bit, I stumbled across the new snippet functionality in Visual Studio 2010. You can now use snippets in the markup files as well (in previous versions you could only use the snippet functionality in code files like class/interfaces/code-behind files etc). This is very cool, and Microsoft has even included a few snippets for their ASP.NET controls and for HTML elements like: a, table, img, div etc. Quite a time saver! </p>
<p>To test the snippets out, simply type the shortcut (eg. &#8216;a&#8217; or &#8216;table&#8217;) and press tab. </p>
<p><img src="http://www.frederikvig.com/wp-content/uploads/VS2010/table.png" alt="Visual Studio 2010 table snippet" /></p>
<p><img src="http://www.frederikvig.com/wp-content/uploads/VS2010/table-after-tab.png" alt="Visual Studio 2010 table snippet" /></p>
<p>This is a simple, but very cool feature. Imaging all the typing you can get rid off! </p>
<h3>Creating your own snippets</h3>
<p>In Visual Studio 2010, under the Tools menu, you&#8217;ll find the Code Snippets Manager (ctrl+k, ctrl+b).  </p>
<p><img src="http://www.frederikvig.com/wp-content/uploads/VS2010/snippets-manager.png" alt="Visual Studio 2010 Code Snippets Manager" /></p>
<p>Here you can add new folders that contain your custom snippets, or check out the other snippets added by Microsoft. You&#8217;ll also see the path to the snippets folder (C:\Program Files (x86)\Microsoft Visual Studio 10.0\Web\Snippets\HTML\1033\ in my case). If you open up that folder in Windows Explorer you should see at least two folders there, ASP.NET and HTML. Inside both of these folders you&#8217;ll find the snippets for the ASP.NET web controls and for HTML elements. We can open up one of the files and take a look at the code.</p>
<div class="wp_syntax">
<div class="code">
<pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;CodeSnippet</span> <span style="color: #000066;">Format</span>=<span style="color: #ff0000;">&quot;1.1.0&quot;</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Header<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>image<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Microsoft Corporation<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Shortcut<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>image<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Shortcut<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;AlternativeShortcuts<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Shortcut<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>imagebutton<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Shortcut<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Shortcut</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;image&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>asp:image<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Shortcut<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Shortcut</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;imagebutton&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>asp:imagebutton<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Shortcut<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/AlternativeShortcuts<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Markup snippet for a control that contains an image<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SnippetTypes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SnippetType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Expansion<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SnippetType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SnippetTypes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Header<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Snippet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Declarations<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Literal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ID<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>imageurl<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ID<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ToolTip<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>imageurl<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ToolTip<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>imageurl<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Literal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Declarations<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Code</span> <span style="color: #000066;">Language</span>=<span style="color: #ff0000;">&quot;html&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #339933;">&lt;![CDATA[&lt;asp:$shortcut$ imageurl=&quot;$imageurl$&quot; runat=&quot;server&quot; /&gt;$end$]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Code<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Snippet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/CodeSnippet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre>
</div>
</div>
<p>Very easy and readable XML markup, that we easily can tweak to our needs. Say we&#8217;re working on a project where 90% of the tables we create should have a class of &#8220;products&#8221;. Lets create a snippet for this, so that we don&#8217;t have to type the same thing every time. </p>
<p>Create a new snippet called table-products.snippet, open it up in your favorite code editor and add this code.</p>
<div class="wp_syntax">
<div class="code">
<pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;CodeSnippet</span> <span style="color: #000066;">Format</span>=<span style="color: #ff0000;">&quot;1.1.0&quot;</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Header<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>table<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Frederik Vig<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Shortcut<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>tablep<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Shortcut<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Markup snippet for a table with class products<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SnippetTypes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SnippetType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Expansion<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SnippetType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SnippetType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>SurroundsWith<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SnippetType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SnippetTypes<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Header<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Snippet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Declarations<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Literal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ID<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>cellspacing<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ID<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ToolTip<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>cellspacing<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ToolTip<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Literal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Declarations<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Code</span> <span style="color: #000066;">Language</span>=<span style="color: #ff0000;">&quot;html&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #339933;">&lt;![CDATA[&lt;table cellspacing=&quot;$cellspacing$&quot; class=&quot;products&quot;&gt;</span>
<span style="color: #339933;">    &lt;tr&gt;</span>
<span style="color: #339933;">        &lt;td&gt;$selected$$end$&lt;/td&gt;</span>
<span style="color: #339933;">    &lt;/tr&gt;</span>
<span style="color: #339933;">&lt;/table&gt;]]&gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Code<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Snippet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/CodeSnippet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre>
</div>
</div>
<p>I&#8217;ve saved table-products.snippet directly in the HTML snippet folder (C:\Program Files (x86)\Microsoft Visual Studio 10.0\Web\Snippets\HTML\1033\HTML in my case), but you can save it anywhere, just remember to add the snippet folder with the Code Snippets Manager in Visual Studio. </p>
<p>We can now test the snippet by typing tablep and pressing tab.</p>
<p><img src="http://www.frederikvig.com/wp-content/uploads/VS2010/tablep.png" alt="Visual Studio 2010 table products snippet" /></p>
<p>
<img src="http://www.frederikvig.com/wp-content/uploads/VS2010/tablep-after-tab.png" alt="Visual Studio 2010 table products snippet" />
</p>
<p>Simple example, I know, but you get the idea!.</p>
<h3>EPiServer</h3>
<p>Naturally, one of the first things I did was add the <a href="http://www.frederikvig.com/2009/07/episerver-web-controls-property/">EPiServer Property web control</a> to the snippet manager <img src='http://www.frederikvig.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . This turned out to be very easy! So I continued on adding snippets for the other EPiServer web controls as well. Here is the list of snippets with their shortcut.</p>
<ul>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_Calendar.htm">EPiServer Calendar</a> &#8211; shortcut: ec</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_CategoryDataSource.htm">EPiServer CategoryDataSource</a> &#8211; shortcut: ecd</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_FileSystemDataSource.htm">EPiServer FileSystemDataSource</a> &#8211; shortcut: efsd</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_LanguageDataSource.htm">EPiServer LanguageDataSource</a> &#8211; shortcut: eld</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_MembershipUserDataSource.htm">EPiServer MembershipUserDataSource</a> &#8211; shortcut: emud</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_MenuList.htm">EPiServer MenuList</a> &#8211; shortcut: eml</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_NewsList.htm">EPiServer NewsList</a> &#8211; shortcut: enl</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_OnPageEditControl.htm">EPiServer OnPageEditControl</a> &#8211; shortcut: eopec</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_PageDataSource.htm">EPiServer PageDataSource</a> &#8211; shortcut: epd</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_PageDefinitionDataSource.htm">EPiServer PageDefinitionDataSource</a> &#8211; shortcut: epdd</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_PageDefinitionTypeDataSource.htm">EPiServer PageDefinitionTypeDataSource</a> &#8211; shortcut: epdtd</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_PageList.htm">EPiServer PageList</a> &#8211; shortcut: epl</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_PageListData.htm">EPiServer PageListData</a> &#8211; shortcut: epld</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_PageTree.htm">EPiServer PageTree</a> &#8211; shortcut: ept</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_PageTreeData.htm">EPiServer PageTreeData</a> &#8211; shortcut: eptd</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_PageVersionDataSource.htm">EPiServer PageVersionDataSource</a> &#8211; shortcut: epvd</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_Property.htm">EPiServer Property</a> &#8211; shortcut: ep</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_PropertyCriteriaControl.htm">EPiServer PropertyCriteriaControl</a> &#8211; shortcut: epcc</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_SearchDataSource.htm">EPiServer SearchDataSource</a> &#8211; shortcut: esd</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_SoftLinkDataSource.htm">EPiServer SoftLinkDataSource</a> &#8211; shortcut: esld</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_SubscriptionDataSource.htm">EPiServer SubscriptionDataSource</a> &#8211; shortcut: esds</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_TabDefinitionDataSource.htm">EPiServer TabDefinitionDataSource</a> &#8211; shortcut: etdd</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_ThemeImage.htm">EPiServer ThemeImage</a> &#8211; shortcut: eti</li>
<li><a href="http://sdk.episerver.com/library/cms6/html/T_EPiServer_Web_WebControls_Translate.htm">EPiServer Translate</a> &#8211; shortcut: et</li>
</ul>
<p><a href="http://www.frederikvig.com/wp-content/uploads/VS2010/EPiServer-VS2010-Snippets.zip">Download the snippets</a></p>
<p> <strong>Related Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.frederikvig.com/2010/03/starting-out-with-xslt-in-umbraco/" rel="bookmark" title="March 20, 2010">Starting out with XSLT in Umbraco</a></li>
<li><a href="http://www.frederikvig.com/2010/04/creating-a-simple-image-gallery-with-episerver/" rel="bookmark" title="April 3, 2010">Creating a simple image gallery with EPiServer</a></li>
<li><a href="http://www.frederikvig.com/2009/12/part-1-setting-up-the-development-environment-create-an-episerver-site-from-scratch/" rel="bookmark" title="December 4, 2009">Part 1: Setting up the development environment &#8211; Create an EPiServer site from scratch</a></li>
<li><a href="http://www.frederikvig.com/2010/05/creating-a-contact-form-with-asp-net-mvc/" rel="bookmark" title="May 13, 2010">Creating a contact form with ASP.NET MVC</a></li>
<li><a href="http://www.frederikvig.com/2010/01/episerver-code-walkthrough-1-404-handler/" rel="bookmark" title="January 29, 2010">EPiServer code walkthrough #1 &#8211; 404 handler</a></li>
</ul>
<p><!-- Similar Posts took 14.710 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.frederikvig.com/2010/02/visual-studio-2010-episerver-snippets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
