posts - 218, comments - 222, trackbacks - 68

My Links

News




I am a Microsoft Certified Application Developer MCAD Chartered Member (C# .Net) and born in Bangladesh.
I work for Ocean Informatics Pty Ltd as a Senior Developer - Analyst.
I am also co-founder and core developer of Pageflakes (acquired by LiveUniverse) www.pageflakes.com
and most recently created SmartCodeGenerator

My Articles
Flexible and Plugin based .Net Application..
Mass Emailing Functionality with C#, .NET 2.0, and Microsoft® SQL Server 2005 Service Broker'
Write your own Code Generator or Template Engine in .NET
Smart Code Generator .NET: Usage Overview
Smart Code Generator .NET: Architectural Overview
Smart Code Generator .NET: using with NAnt and Cassini

Archives

Free Programming Language Training

Example1: SmartCodeGenerator Familiarization

Example1 Makes you familiar with SmartCodeGenerator.
Generating code from existing project/template.

Step1 Opening Existing Template

Open Example1 from Example_Projects folder, as a website project in Visual Studio 2005.

Step2 Launching the Generator

Run the project you have opened from Visual Studio 2005 and this will display the default.aspx page.

Notice the property1 and the textbox to enter value. The properties lets you customize the generated code. Here we are collecting value for property1 and this can be used in the generated template.

Step3 Generating the Text or Code

Simply click the Generate Button. And this will generate code for you. If there was any compilation error VS2005 would have picked that up very easily as it normally does for your asp.net application.

Step5. Reviewing the Template

Expand the Template Folder and open Exampl11Template.ascx file and go to source view. This would look like the following.

And the Code behind is where I have declared a property CurrentDateTime.

And the Generated Code should look like this. The DateTime.Now.ToString() is simply replaced by the current datetime.

And remember you have full support of the Greatest Visual Studio 2005 Environment [Debugging, Compilation, CodeSnippet and countless etc.]

Print | posted on Saturday, November 25, 2006 10:03 AM |

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 6 and 7 and type the answer here:

Powered by: