Tuesday, February 15, 2005

Text Clips for Programmers Notepad 2 (ASP.NET)

Update (23 June, 2005): Added Directives.

Programmers Notepad 2 has a feature for inserting snippets of code, or text clips into an open document. This is helpful when you have code that is often inserted into multiple files. I have created a clips file which contains snippets useful for ASP.NET development. Create a file in the clips sub directory of the Programmers Notepad directory, with the extension .clips (i.e. aspnet.clips) and paste in the following code:

<?xml version="1.0"?>
<clips name="ASP.NET">
<clip name="----- Directives ----"></clip>
<clip name="Assembly"><![CDATA[<%@ Assembly Name="|" %>]]></clip>
<clip name="Control (C#)"><![CDATA[<%@ Control Language="C#" %>|]]></clip>
<clip name="Control (VB)"><![CDATA[<%@ Control Language="VB" %>|]]></clip>
<clip name="Implements"><![CDATA[<%@ Implements Interface="|" %>]]></clip>
<clip name="Import"><![CDATA[<%@ Import Namespace="|" %>]]></clip>
<clip name="OutputCache"><![CDATA[<%@ OutputCache Duration="100" VaryByParam="none|" %>]]></clip>
<clip name="Page (C#)"><![CDATA[<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="iso-8859-1" %>|]]></clip>
<clip name="Page (VB)"><![CDATA[<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>|]]></clip>
<clip name="Reference (Control)"><![CDATA[<%@ Reference Control="|.ascx" %>]]></clip>
<clip name="Reference (Page)"><![CDATA[<%@ Reference Page="|.aspx" %>]]></clip>
<clip name="Register"><![CDATA[<%@ Register TagPrefix="|" TagName="" Src="" %>]]></clip>
<clip name="----- Web Controls ----"></clip>
<clip name="AdRotator"><![CDATA[<asp:AdRotator id="AdRotator1"
 AdvertisementFile="|.xml"
 runat="server"/>]]></clip>
<clip name="Button"><![CDATA[<asp:Button id="Button1"
 Text="|"
 OnClick=""
 runat="server" />]]></clip>
<clip name="Calendar"><![CDATA[<asp:Calendar id="Calendar1"
 runat="server">
</asp:Calendar>]]></clip>
<clip name="CheckBox"><![CDATA[<asp:CheckBox id="CheckBox1" 
 Text="|"
 runat="server" />]]></clip>
<clip name="CheckBoxList"><![CDATA[<asp:CheckBoxList id="CheckBoxList1"
 DataSource='<%# | %>'
 DataTextField=""
 DataValueField=""
 runat="server">
 <asp:ListItem Value="" Selected=""></asp:ListItem>
</asp:CheckBoxList>]]></clip>
<clip name="DataGrid"><![CDATA[<asp:DataGrid id="DataGrid1"
 DataSource='<%# | %>'
 runat="server">
</asp:DataGrid>]]></clip>
<clip name="DataList"><![CDATA[<asp:DataList id="DataList1"
 DataKeyField=""
 DataSource='<%# | %>'
 runat="server">
</asp:DataList>]]></clip>
<clip name="DropDownList"><![CDATA[<asp:DropDownList id="DropDownList1"
 DataSource='<%# | %>'
 DataTextField=""
 DataValueField=""
 runat="server">
 <asp:ListItem Value="" Selected=""></asp:ListItem>
</asp:DropDownList>]]></clip>
<clip name="HyperLink"><![CDATA[<asp:HyperLink id="HyperLink1"
 Text="|"
 ToolTip=""
 NavigateUrl=""
 runat="server" />]]></clip>
<clip name="Image"><![CDATA[<asp:Image id="Image1"
 ImageUrl="|"
 AlternateText=""
 ImageAlign=""
 runat="server" />]]></clip>
<clip name="ImageButton"><![CDATA[<asp:ImageButton id="ImageButton1"
 ImageUrl="|"
 OnClick=""
 runat="server" />]]></clip>
<clip name="Label"><![CDATA[<asp:Label id="Label1" Text="|" runat="server" />]]></clip>
<clip name="LinkButton"><![CDATA[<asp:LinkButton id="LinkButton1"
 Text="|"
 OnClick=""
 runat="server" />]]></clip>
<clip name="ListBox"><![CDATA[<asp:ListBox id="ListBox1"
 DataSource='<%# | %>'
 DataTextField=""
 DataValueField=""
 runat="server">
 <asp:ListItem Value="" Selected=""></asp:ListItem>
</asp:ListBox>]]></clip>
<clip name="Literal"><![CDATA[<asp:Literal id="Literal1" Text="|" runat="server" />]]></clip>
<clip name="Panel"><![CDATA[<asp:Panel id="Panel1" runat="server">
|
</asp:Panel>]]></clip>
<clip name="PlaceHolder"><![CDATA[<asp:PlaceHolder id="PlaceHolder1" runat="server" />]]></clip>
<clip name="RadioButton"><![CDATA[<asp:RadioButton id="RadioButton1" 
 Checked="|"
 GroupName=""
 Text=""
 runat="server" />]]></clip>
<clip name="RadioButtonList"><![CDATA[<asp:RadioButtonList id="RadioButtonList1"
 DataSource='<%# | %>'
 DataTextField=""
 DataValueField=""
 RepeatColumns=""
 RepeatDirection=""
 RepeatLayout=""
 TextAlign=""
 runat="server">
 <asp:ListItem Value="" Selected=""></asp:ListItem>
</asp:RadioButtonList>]]></clip>
<clip name="Repeater"><![CDATA[<asp:Repeater id="Repeater1"
 DataSource='<%# | %>'
 runat="server">
 <HeaderTemplate>

 </HeaderTemplate>
 <ItemTemplate>

 </ItemTemplate>
 <AlternatingItemTemplate>

 </AlternatingItemTemplate>
 <SeparatorTemplate>

 </SeparatorTemplate>
 <FooterTemplate>

 </FooterTemplate>
</asp:Repeater>]]></clip>
<clip name="Table"><![CDATA[<asp:Table id="Table1"
 CellSpacing=""
 CellPadding=""
 GridLines=""
 HorizontalAlign=""
 runat="server">
 <asp:TableRow>
  <asp:TableCell>
  |
  </asp:TableCell>
 </asp:TableRow>
</asp:Table>]]></clip>
<clip name="TableCell"><![CDATA[<asp:TableCell id="TableCell1"
 ColumnSpan=""
 RowSpan=""
 HorizontalAlign=""
 VerticalAlign=""
 Wrap=""
 runat="server">
 |
</asp:TableCell>]]></clip>
<clip name="TableRow"><![CDATA[<asp:TableRow id="TableRow1"
 HorizontalAlign=""
 VerticalAlign=""
 runat="server">
 <asp:TableCell>
 |
 </asp:TableCell>
</asp:TableRow>]]></clip>
<clip name="TextBox"><![CDATA[<asp:TextBox id="TextBox1"
 Columns=""
 MaxLength=""
 Rows=""
 Text="|"
 TextMode=""
 Wrap=""
 runat="server" />]]></clip>
<clip name="Xml"><![CDATA[<asp:Xml id="Xml1"
 Document=""
 DocumentContent=""
 DocumentSource=""
 Transform=""
 TransformSource=""
 runat="server" />]]></clip>
<clip name="----- Validation Controls -----"></clip>
<clip name="CompareValidator"><![CDATA[<asp:CompareValidator id="CompareValidator1"
 ControlToValidate="|"
 ValueToCompare=""
 Type=""
 Operator=""
 ErrorMessage=""
 runat="server">
</asp:CompareValidator>]]></clip>
<clip name="CustomValidator"><![CDATA[<asp:CustomValidator id="CustomValidator1"
 runat="server"
 ControlToValidate="|"
 ClientValidationFunction=""
 OnServerValidate=""
 ErrorMessage="">
</asp:CustomValidator>]]></clip>
<clip name="RangeValidator"><![CDATA[<asp:RangeValidator id="RangeValidator1"
 ControlToValidate="|"
 MinimumValue=""
 Type=""
 ErrorMessage=""
 runat="server">
</asp:RangeValidator>]]></clip>
<clip name="RegularExpressionValidator"><![CDATA[<asp:RegularExpressionValidator id="RegularExpressionValidator1" 
 ControlToValidate="|"
 ValidationExpression=""
 ErrorMessage=""
 runat="server">
</asp:RegularExpressionValidator>]]></clip>
<clip name="RequiredFieldValidator"><![CDATA[<asp:RequiredFieldValidator id="RequiredFieldValidator1"
 ControlToValidate="|"
 InitialValue=""
 ErrorMessage=""
 runat="server">
</asp:RequiredFieldValidator>]]></clip>
<clip name="ValidationSummary"><![CDATA[<asp:ValidationSummary id="ValidationSummary1"
 DisplayMode="|"
 EnableClientScript=""
 ShowSummary=""
 ShowMessageBox=""
 HeaderText=""
 runat="server" />]]></clip>
</clips>

Tags: , , ,

3 comments:

Simon said...

Thanks Sam!

Anonymous said...

Do you happen to have ASP.NET highlighter for PN2?

Thanks for the clips.

tadas@etasoft.com

Sam said...

It's a feature request, both for PN2 and Scintilla (the control that provides the highlighting and folding). Would do it myself if I had the ability, but perhaps someone with C++ experience will (not the main developer as he does not use ASP.NET)?

PN2: [ 1195104 ] ASP.NET Support
Scintilla: [ 1195783 ] Support for ASP.NET

Unless you meant highlighting for the tags? Simply add the tags to the keywords list in Tools > Options > Schemes > Scheme:Hypertext > Keywords. (i.e. asp:hyperlink asp:button).