Telerik blogs

When you add a new page to your Web site, do you often find yourself cutting and pasting from another page to get started? If you're spending more time importing controls and setting up content regions for your master page than actually working on the new page, you might want to look into creating a "RadControls T4 Item Template" in Visual Studio with “RadControls for ASP.NET AJAX VS Extensions”

Below is a basic way to get started with a “RadControls for ASP.NET AJAX” T4 Item Templates.

To create your own RadControls T4 Item Template:

  1. Create a file – (MyTemplate.t4).

MyTemplate

 

 

 

2.    Create a file TemplateInfo.xml.  This is basically the file that contains XML that the wizard can read to understand how it should display your template.  See code sample below.

TemplateInfo

 

3.    Add the MyTemplate.t4 and TemplateInfo.xml to the appropriate ItemTemplate folder found in your RadControls for ASP.NET AJAX installation folder, for example:
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q1 2009\VSExtensions\Templates\ItemTemplates\General\MyTemplateFolder

4.    If you have the Visual Studio open when you pasted the files you will need to exit Visual Studio.  Restart Visual Studio, open your project and select the “Project” menu and choose  the “Telerik->Add RadControls Template…” menu item

Dialog

 

5.    Select “My T4 Template WebForm” and click Next. The Basic Wizard Information dialog box appears.

Dialog1

 

6.    Click Next And Select date from the DateTime picker

Dialog2

7.    Click Finish. After a few moments, the Telerik Wizard will create a new Project Item.

 

Initially, you'll have a basic Item with minimal functionality. You can try it out by run the application

IE

 

 

  (Unzip, copy and paste the files into

[RadControls Installation Folder]\VSExtensions\Templates\ItemTemplates\General\MyTemplateFolder\ )

 

In the next post we will look into the properties determining the structure of the TemplateInfo.xml file.

 

Plamen Peshev | The Telerik VSXTeam


Comments

Comments are disabled in preview mode.