WebForms Part Tutorial

This tutorial assumes you have added the Visual Studio item templates. How to do this is documented in Setting Up Your Environment

Right-click on the project, Add, New item… , select N2 Item Template and Add.

Use the n2propfta template to add a free text area snippet. Give the property the name Text.

Edit TutorialPart.ascx and add a display control:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TutorialPart.ascx.cs" Inherits="N2.UI.TutorialPart" %>
<div style="border:solid 10px red">
     <n2:Display runat="server" propertyname="Text" />
</div>

Compile and Voila! – select “Organize parts” and drag TutorialPartItem into a zone to see it in action.