home *** CD-ROM | disk | FTP | other *** search
-
-
- <%@ Register TagPrefix="Acme" TagName="SourceRef" Src="/quickstart/util/SrcRef.aspx"%>
-
- <!-- #include virtual="/quickstart/aspplus/include/header.inc" -->
-
- <h4>Authoring Custom Controls</h4>
- <p>
-
- <!-- #include virtual="/quickstart/aspplus/include/wftoc7.inc" -->
- <p>
- <hr>
-
- This section of the quickstart demonstrates how advanced developers can write their
- own ASP+ Server Controls that participate within the ASP+ Web Forms Page Framework.
-
- <p>
-
- <!--BEGIN SECTION-->
- <a name="simplectrl">
- <span class="subhead">Writing a Simple Control</span>
- <p>
-
- The below example demonstrates how to write a super-simple control that renders
- a simple "Hello World!" style message string.
-
- <p>
-
- <Acme:SourceRef
- RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/simple/Simple.aspx"
- ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/simple/Simple.src"
- Icon="/quickstart/aspplus/images/ctrlauth1.gif"
- Caption="Simple.aspx"
- runat="server" />
-
-
- <!--BEGIN SECTION-->
- <p>
- <a name="properties">
- <br>
- <span class="subhead">Adding Properties and Methods</span>
- <p>
-
- The below example demonstrates how to write a simple control that exposes three
- custom properties (of type: string, integer and enum) and then uses them to
- render some custom content.
-
- <p>
-
- <Acme:SourceRef
- RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/simple/SimpleProperty.aspx"
- ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/simple/SimpleProperty.src"
- Icon="/quickstart/aspplus/images/ctrlauth2.gif"
- Caption="SimpleProperty.aspx"
- runat="server" />
-
-
- <!--BEGIN SECTION-->
- <p>
- <a name="classprops">
- <br>
- <span class="subhead">Adding Class Properties</span>
- <p>
-
- The below example demonstrates how to write a simple control that exposes a
- complex property (ie: a property that in turn contains other properties).
- Complex property support enables ASP+ developers to hierarchically
- organize values on a control.
-
- <p>
-
- <Acme:SourceRef
- RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/simple/SimpleSubProperty.aspx"
- ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/simple/SimpleSubProperty.src"
- Icon="/quickstart/aspplus/images/ctrlauth3.gif"
- Caption="SimpleSubProperty.aspx"
- runat="server" />
-
-
- <!--BEGIN SECTION-->
- <p>
- <a name="innercontent">
- <br>
- <span class="subhead">Retrieving Inner Content</span>
- <p>
-
- The below example demonstrates how to write a simple control that retrieves
- its inner content within a page and renders it back to a client.
-
- <p>
-
- <Acme:SourceRef
- RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/simple/SimpleInnerContent.aspx"
- ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/simple/SimpleInnerContent.src"
- Icon="/quickstart/aspplus/images/ctrlauth4.gif"
- Caption="SimpleInnerContent.aspx"
- runat="server" />
-
- <!--BEGIN SECTION-->
- <p>
- <a name="composition">
- <br>
- <span class="subhead">Control Composition</span>
- <p>
-
- The below example demonstrates how to write a control that composes itself from other
- server controls:
-
- <p>
-
- <Acme:SourceRef
- RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/composition/Composition1.aspx"
- ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/composition/Composition1.src"
- Icon="/quickstart/aspplus/images/ctrlauth5.gif"
- Caption="Composition1.aspx"
- runat="server" />
-
-
- <!--BEGIN SECTION-->
- <p>
- <a name="postbackevts">
- <br>
- <span class="subhead">Handling Postback Events using Control Composition</span>
- <p>
-
- The below example demonstrates how to write a control that composes itself from other
- server controls, and then uses those server controls to sync and handle postback events.
-
- <p>
-
- <Acme:SourceRef
- RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/composition/Composition2.aspx"
- ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/composition/Composition2.src"
- Icon="/quickstart/aspplus/images/ctrlauth6.gif"
- Caption="Composition2.aspx"
- runat="server" />
-
- <!--BEGIN SECTION-->
- <p>
- <a name="exposingevts">
- <br>
- <span class="subhead">Exposing Events to a Page (using Control Composition)</span>
- <p>
-
- The below example demonstrates how to write a control that composes itself from other
- server controls, uses those server controls to sync and handle postback events, and
- then exposes and raises custom events to page developers.
-
- <p>
-
- <Acme:SourceRef
- RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/composition/Composition3.aspx"
- ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/composition/Composition3.src"
- Icon="/quickstart/aspplus/images/ctrlauth7.gif"
- Caption="Composition3.aspx"
- runat="server" />
-
-
- <!--BEGIN SECTION-->
- <p>
- <a name="viewstate">
- <br>
- <span class="subhead">Maintaining Viewstate</span>
- <p>
-
- The below example demonstrates how to utilize the Control class's "State" dictionary to
- store viewstate information accross multiple web requests.
-
- <p>
-
- <Acme:SourceRef
- RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/viewstate/Label.aspx"
- ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/viewstate/Label.src"
- Icon="/quickstart/aspplus/images/ctrlauth8.gif"
- Caption="Label.aspx"
- runat="server" />
-
-
- <!--BEGIN SECTION-->
- <p>
- <a name="noncomposition">
- <br>
- <span class="subhead">Non-Compositional Controls</span>
- <p>
-
- The below example demonstrates how to write a control that <u>does not</u> compose itself from other
- server controls, but instead directly renders its content and utilizes the IPostBackDataHandler
- interface to gather client-side input.
-
- <p>
-
- <Acme:SourceRef
- RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/noncomposition/NonComposition1.aspx"
- ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/noncomposition/NonComposition1.src"
- Icon="/quickstart/aspplus/images/ctrlauth9.gif"
- Caption="NonComposition1.aspx"
- runat="server" />
-
- <p>
-
- The below example demonstrates how to write a control that <u>does not</u> compose itself from other
- server controls, but instead directly renders its content, utilizes the IPostBackDataHandler
- interface to gather client-side input, and utilizes the IPostBackEventHandler interface to handle
- client-side postback events.
-
- <p>
-
- <Acme:SourceRef
- RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/noncomposition/NonComposition2.aspx"
- ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/noncomposition/NonComposition2.src"
- Icon="/quickstart/aspplus/images/ctrlauth10.gif"
- Caption="NonComposition2.aspx"
- runat="server" />
-
-
- <!--BEGIN SECTION-->
- <p>
- <a name="templated">
- <br>
- <span class="subhead">Writing a Templated Control</span>
- <p>
-
- The below example demonstrates how to write a control that exposes custom templates that enable
- control consumers to customize the shape and structure of it.
-
- <p>
-
- <Acme:SourceRef
- RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/templates/Template1.aspx"
- ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/templates/Template1.src"
- Icon="/quickstart/aspplus/images/ctrlauth11.gif"
- Caption="Template1.aspx"
- runat="server" />
-
-
- <!--BEGIN SECTION-->
- <p>
- <a name="templatedlist">
- <br>
- <span class="subhead">Writing a Templated List Control</span>
- <p>
-
- The below example demonstrates how to write a list control that exposes custom templates that enable
- control consumers to customize the shape and structure of it.
-
- <p>
-
- <Acme:SourceRef
- RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/templates/Repeater1.aspx"
- ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/templates/Repeater1.src"
- Icon="/quickstart/aspplus/images/ctrlauth12.gif"
- Caption="Repeater1.aspx"
- runat="server" />
-
- <p>
-
- The below example demonstrates how to write a list control that exposes custom templates that enable
- control consumers to customize the shape and structure of it, and then enables a page consumer to
- walk its "Items" collection during postback to pull out values from it.
-
- <p>
-
- <Acme:SourceRef
- RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/templates/Repeater2.aspx"
- ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/templates/Repeater2.src"
- Icon="/quickstart/aspplus/images/ctrlauth13.gif"
- Caption="Repeater2.aspx"
- runat="server" />
-
-
- <!--BEGIN SECTION-->
- <p>
- <a name="builder">
- <br>
- <span class="subhead">Custom Parsing Controls</span>
- <p>
-
- The below sample demonstrates how a container control can receive custom interception notification
- (and take custom action) when a child control is inserted into the control hierarchy tree.
-
- <p>
-
- <Acme:SourceRef
- RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/customparsing/CustomParse1.aspx"
- ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/customparsing/CustomParse1.src"
- Icon="/quickstart/aspplus/images/ctrlauth14.gif"
- Caption="CustomParse1.aspx"
- runat="server" />
-
- <p>
-
- The below sample demonstrates how a control can expose a custom ControlBuilder class that enables
- it to participate in the control identification of tags during parse-time.
-
- <p>
-
- <Acme:SourceRef
- RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/customparsing/CustomParse2.aspx"
- ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/customparsing/CustomParse2.src"
- Icon="/quickstart/aspplus/images/ctrlauth15.gif"
- Caption="CustomParse2.aspx"
- runat="server" />
-
- <!-- #include virtual="/quickstart/aspplus/include/footer.inc" -->