home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / QuickStart / aspplus / doc / webctrlauthoring.aspx < prev    next >
Encoding:
Text File  |  2000-06-11  |  9.4 KB  |  304 lines

  1.  
  2.  
  3. <%@ Register TagPrefix="Acme" TagName="SourceRef" Src="/quickstart/util/SrcRef.aspx"%>
  4.  
  5. <!-- #include virtual="/quickstart/aspplus/include/header.inc" -->
  6.  
  7. <h4>Authoring Custom Controls</h4>
  8. <p>
  9.  
  10. <!-- #include virtual="/quickstart/aspplus/include/wftoc7.inc" -->
  11. <p>
  12. <hr>
  13.  
  14. This section of the quickstart demonstrates how advanced developers can write their 
  15. own ASP+ Server Controls that participate within the ASP+ Web Forms Page Framework.
  16.  
  17. <p>
  18.  
  19. <!--BEGIN SECTION-->
  20. <a name="simplectrl">
  21. <span class="subhead">Writing a Simple Control</span>
  22. <p>
  23.  
  24. The below example demonstrates how to write a super-simple control that renders 
  25. a simple "Hello World!" style message string.
  26.  
  27. <p>
  28.  
  29. <Acme:SourceRef
  30.   RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/simple/Simple.aspx"
  31.   ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/simple/Simple.src"
  32.   Icon="/quickstart/aspplus/images/ctrlauth1.gif"
  33.   Caption="Simple.aspx"
  34.   runat="server" />
  35.  
  36.  
  37. <!--BEGIN SECTION-->
  38. <p>
  39. <a name="properties">
  40. <br>
  41. <span class="subhead">Adding Properties and Methods</span>
  42. <p>
  43.  
  44. The below example demonstrates how to write a simple control that exposes three
  45. custom properties (of type: string, integer and enum) and then uses them to 
  46. render some custom content.
  47.  
  48. <p>
  49.  
  50. <Acme:SourceRef
  51.   RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/simple/SimpleProperty.aspx"
  52.   ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/simple/SimpleProperty.src"
  53.   Icon="/quickstart/aspplus/images/ctrlauth2.gif"
  54.   Caption="SimpleProperty.aspx"
  55.   runat="server" />
  56.  
  57.  
  58. <!--BEGIN SECTION-->
  59. <p>
  60. <a name="classprops">
  61. <br>
  62. <span class="subhead">Adding Class Properties</span>
  63. <p>
  64.  
  65. The below example demonstrates how to write a simple control that exposes a 
  66. complex property (ie: a property that in turn contains other properties).
  67. Complex property support enables ASP+ developers to hierarchically
  68. organize values on a control.
  69.  
  70. <p>
  71.  
  72. <Acme:SourceRef
  73.   RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/simple/SimpleSubProperty.aspx"
  74.   ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/simple/SimpleSubProperty.src"
  75.   Icon="/quickstart/aspplus/images/ctrlauth3.gif"
  76.   Caption="SimpleSubProperty.aspx"
  77.   runat="server" />
  78.  
  79.  
  80. <!--BEGIN SECTION-->
  81. <p>
  82. <a name="innercontent">
  83. <br>
  84. <span class="subhead">Retrieving Inner Content</span>
  85. <p>
  86.  
  87. The below example demonstrates how to write a simple control that retrieves
  88. its inner content within a page and renders it back to a client.
  89.  
  90. <p>
  91.  
  92. <Acme:SourceRef
  93.   RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/simple/SimpleInnerContent.aspx"
  94.   ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/simple/SimpleInnerContent.src"
  95.   Icon="/quickstart/aspplus/images/ctrlauth4.gif"
  96.   Caption="SimpleInnerContent.aspx"
  97.   runat="server" />
  98.  
  99. <!--BEGIN SECTION-->
  100. <p>
  101. <a name="composition">
  102. <br>
  103. <span class="subhead">Control Composition</span>
  104. <p>
  105.  
  106. The below example demonstrates how to write a control that composes itself from other
  107. server controls:
  108.  
  109. <p>
  110.  
  111. <Acme:SourceRef
  112.   RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/composition/Composition1.aspx"
  113.   ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/composition/Composition1.src"
  114.   Icon="/quickstart/aspplus/images/ctrlauth5.gif"
  115.   Caption="Composition1.aspx"
  116.   runat="server" />
  117.  
  118.  
  119. <!--BEGIN SECTION-->
  120. <p>
  121. <a name="postbackevts">
  122. <br>
  123. <span class="subhead">Handling Postback Events using Control Composition</span>
  124. <p>
  125.  
  126. The below example demonstrates how to write a control that composes itself from other
  127. server controls, and then uses those server controls to sync and handle postback events.
  128.  
  129. <p>
  130.  
  131. <Acme:SourceRef
  132.   RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/composition/Composition2.aspx"
  133.   ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/composition/Composition2.src"
  134.   Icon="/quickstart/aspplus/images/ctrlauth6.gif"
  135.   Caption="Composition2.aspx"
  136.   runat="server" />
  137.  
  138. <!--BEGIN SECTION-->
  139. <p>
  140. <a name="exposingevts">
  141. <br>
  142. <span class="subhead">Exposing Events to a Page (using Control Composition)</span>
  143. <p>
  144.  
  145. The below example demonstrates how to write a control that composes itself from other
  146. server controls, uses those server controls to sync and handle postback events, and 
  147. then exposes and raises custom events to page developers.
  148.  
  149. <p>
  150.  
  151. <Acme:SourceRef
  152.   RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/composition/Composition3.aspx"
  153.   ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/composition/Composition3.src"
  154.   Icon="/quickstart/aspplus/images/ctrlauth7.gif"
  155.   Caption="Composition3.aspx"
  156.   runat="server" />
  157.  
  158.  
  159. <!--BEGIN SECTION-->
  160. <p>
  161. <a name="viewstate">
  162. <br>
  163. <span class="subhead">Maintaining Viewstate</span>
  164. <p>
  165.  
  166. The below example demonstrates how to utilize the Control class's "State" dictionary to
  167. store viewstate information accross multiple web requests.
  168.  
  169. <p>
  170.  
  171. <Acme:SourceRef
  172.   RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/viewstate/Label.aspx"
  173.   ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/viewstate/Label.src"
  174.   Icon="/quickstart/aspplus/images/ctrlauth8.gif"
  175.   Caption="Label.aspx"
  176.   runat="server" />
  177.  
  178.  
  179. <!--BEGIN SECTION-->
  180. <p>
  181. <a name="noncomposition">
  182. <br>
  183. <span class="subhead">Non-Compositional Controls</span>
  184. <p>
  185.  
  186. The below example demonstrates how to write a control that <u>does not</u> compose itself from other
  187. server controls, but instead directly renders its content and utilizes the IPostBackDataHandler
  188. interface to gather client-side input.
  189.  
  190. <p>
  191.  
  192. <Acme:SourceRef
  193.   RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/noncomposition/NonComposition1.aspx"
  194.   ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/noncomposition/NonComposition1.src"
  195.   Icon="/quickstart/aspplus/images/ctrlauth9.gif"
  196.   Caption="NonComposition1.aspx"
  197.   runat="server" />
  198.  
  199. <p>
  200.  
  201. The below example demonstrates how to write a control that <u>does not</u> compose itself from other
  202. server controls, but instead directly renders its content, utilizes the IPostBackDataHandler
  203. interface to gather client-side input, and utilizes the IPostBackEventHandler interface to handle
  204. client-side postback events.
  205.  
  206. <p>
  207.  
  208. <Acme:SourceRef
  209.   RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/noncomposition/NonComposition2.aspx"
  210.   ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/noncomposition/NonComposition2.src"
  211.   Icon="/quickstart/aspplus/images/ctrlauth10.gif"
  212.   Caption="NonComposition2.aspx"
  213.   runat="server" />
  214.  
  215.  
  216. <!--BEGIN SECTION-->
  217. <p>
  218. <a name="templated">
  219. <br>
  220. <span class="subhead">Writing a Templated Control</span>
  221. <p>
  222.  
  223. The below example demonstrates how to write a control that exposes custom templates that enable
  224. control consumers to customize the shape and structure of it.
  225.  
  226. <p>
  227.  
  228. <Acme:SourceRef
  229.   RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/templates/Template1.aspx"
  230.   ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/templates/Template1.src"
  231.   Icon="/quickstart/aspplus/images/ctrlauth11.gif"
  232.   Caption="Template1.aspx"
  233.   runat="server" />
  234.  
  235.  
  236. <!--BEGIN SECTION-->
  237. <p>
  238. <a name="templatedlist">
  239. <br>
  240. <span class="subhead">Writing a Templated List Control</span>
  241. <p>
  242.  
  243. The below example demonstrates how to write a list control that exposes custom templates that enable
  244. control consumers to customize the shape and structure of it.
  245.  
  246. <p>
  247.  
  248. <Acme:SourceRef
  249.   RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/templates/Repeater1.aspx"
  250.   ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/templates/Repeater1.src"
  251.   Icon="/quickstart/aspplus/images/ctrlauth12.gif"
  252.   Caption="Repeater1.aspx"
  253.   runat="server" />
  254.  
  255. <p>
  256.  
  257. The below example demonstrates how to write a list control that exposes custom templates that enable
  258. control consumers to customize the shape and structure of it, and then enables a page consumer to 
  259. walk its "Items" collection during postback to pull out values from it.
  260.  
  261. <p>
  262.  
  263. <Acme:SourceRef
  264.   RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/templates/Repeater2.aspx"
  265.   ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/templates/Repeater2.src"
  266.   Icon="/quickstart/aspplus/images/ctrlauth13.gif"
  267.   Caption="Repeater2.aspx"
  268.   runat="server" />
  269.  
  270.  
  271. <!--BEGIN SECTION-->
  272. <p>
  273. <a name="builder">
  274. <br>
  275. <span class="subhead">Custom Parsing Controls</span>
  276. <p>
  277.  
  278. The below sample demonstrates how a container control can receive custom interception notification
  279. (and take custom action) when a child control is inserted into the control hierarchy tree.
  280.  
  281. <p>
  282.  
  283. <Acme:SourceRef
  284.   RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/customparsing/CustomParse1.aspx"
  285.   ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/customparsing/CustomParse1.src"
  286.   Icon="/quickstart/aspplus/images/ctrlauth14.gif"
  287.   Caption="CustomParse1.aspx"
  288.   runat="server" />
  289.  
  290. <p>
  291.  
  292. The below sample demonstrates how a control can expose a custom ControlBuilder class that enables
  293. it to participate in the control identification of tags during parse-time.
  294.  
  295. <p>
  296.  
  297. <Acme:SourceRef
  298.   RunSample="/quickstart/aspplus/samples/webforms/ctrlauth/customparsing/CustomParse2.aspx"
  299.   ViewSource="/quickstart/aspplus/samples/webforms/ctrlauth/customparsing/CustomParse2.src"
  300.   Icon="/quickstart/aspplus/images/ctrlauth15.gif"
  301.   Caption="CustomParse2.aspx"
  302.   runat="server" />
  303.  
  304. <!-- #include virtual="/quickstart/aspplus/include/footer.inc" -->