﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WebForms (How do I?)  » Use Control Inherits From StrataFrame Library</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 16:20:54 GMT</lastBuildDate><ttl>20</ttl><item><title>Use Control Inherits From StrataFrame Library</title><link>http://forum.strataframe.net/FindPost1710.aspx</link><description>Can I use my own control, which inherits from StrataFrame library? For example, I define a class called 'Textbox' as below:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;Public&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Class&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; Textbox&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Inherits&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.UI.Web.TextBox&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;End&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Class&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#777777&gt;Will it cause any errors when i try to add,&amp;nbsp;update or delete record?&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Fri, 07 Jul 2006 09:07:41 GMT</pubDate><dc:creator>Wang Tong Yin</dc:creator></item><item><title>RE: Use Control Inherits From StrataFrame Library</title><link>http://forum.strataframe.net/FindPost1765.aspx</link><description>When you override a method, you have to call MyBase.MethodName().&amp;nbsp; So, if you're overriding the OnPaint() method of a control, it would look like this:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;Protected&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Overrides&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; OnPaint(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; e &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; System.Windows.Forms.PaintEventArgs)&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Make the base method call (DODEFAULT())&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase&lt;/FONT&gt;&lt;FONT size=2&gt;.OnPaint(e)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Custom code here&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#1f5080&gt;Now, if you attach to an event, then there is no base or DODEFAULT that you need to call; it will be done automatically.&amp;nbsp; In fact, there is no way to prevent the base methods from firing.&amp;nbsp; Only on method overrides do you need to call the base method.&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Fri, 07 Jul 2006 09:07:41 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Use Control Inherits From StrataFrame Library</title><link>http://forum.strataframe.net/FindPost1763.aspx</link><description>In foxpro we can use DODEFAULT() function to execute parent event or method. This can prevent child class from overwriting the codes in parent class. How to do this in VB.Net?</description><pubDate>Thu, 06 Jul 2006 22:28:43 GMT</pubDate><dc:creator>Wang Tong Yin</dc:creator></item><item><title>RE: Use Control Inherits From StrataFrame Library</title><link>http://forum.strataframe.net/FindPost1733.aspx</link><description>[quote]This means StrataFrame will update and modify the value of the controls in Page.PreLoad and Page.PreRender event?[/quote]&lt;/P&gt;&lt;P&gt;That is correct.&lt;/P&gt;&lt;P&gt;[quote]What will happen if I add code in Page.PreLoad and Page.PreRender event? If error may occur, what I should do to prevent the error?[/quote]&lt;/P&gt;&lt;P&gt;You could add code there.&amp;nbsp; You should handle errors just like any other errors that appear within an ASP.NET page, including the custom error pages if necessary.&lt;/P&gt;&lt;P&gt;[quote]Page.Load and Page.PreRenderComplete are the &lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f5080; FONT-FAMILY: Verdana; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;safe &lt;/SPAN&gt;places for me to add some codes?[/quote]&lt;/P&gt;&lt;P&gt;Correct, those are the safest places to add code.</description><pubDate>Thu, 06 Jul 2006 08:49:17 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Use Control Inherits From StrataFrame Library</title><link>http://forum.strataframe.net/FindPost1730.aspx</link><description>1. This means StrataFrame will update and modify the value of the controls in Page.PreLoad and Page.PreRender event?&lt;/P&gt;&lt;P&gt;2. What will happen if I add code in Page.PreLoad and Page.PreRender event? If error may occur, what I should do to prevent the error?&lt;/P&gt;&lt;P&gt;3. Page.Load and Page.PreRenderComplete are the &lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f5080; FONT-FAMILY: Verdana; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;safe &lt;/SPAN&gt;places for me to add some codes?</description><pubDate>Thu, 06 Jul 2006 08:03:11 GMT</pubDate><dc:creator>Wang Tong Yin</dc:creator></item><item><title>RE: Use Control Inherits From StrataFrame Library</title><link>http://forum.strataframe.net/FindPost1724.aspx</link><description>No, the web controls do not have any hooks for the databinding.&lt;/P&gt;&lt;P&gt;The data is copied through the binding to the control on the Page.PreRender event and the data is copied back from the control on a PostBack through the Page.PreLoad event.&amp;nbsp; So, after the PreRender event, the controls will be populated with the appropriate values for the binding, and successfully modify the value by altering the control after the Page.PreRender event.&amp;nbsp; Same thing goes for the Page.PreLoad event for copying data back from the control.</description><pubDate>Wed, 05 Jul 2006 09:17:41 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Use Control Inherits From StrataFrame Library</title><link>http://forum.strataframe.net/FindPost1718.aspx</link><description>I try to change something on the web controls before displaying them. For example,&amp;nbsp;the value of&amp;nbsp;a textbox will be updated by a function before it shows out. Can I add my code in&amp;nbsp;some event functions like Textbox_Init() and Textbox_Load() as shown below?&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;FONT size=2&gt; Textbox_Init(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; sender &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Object&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; e &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; System.EventArgs) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Handles&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.Init&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Private&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;FONT size=2&gt; Textbox_Load(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; sender &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Object&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; e &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; System.EventArgs) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Handles&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.Load&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#115555&gt;Will it affect the original behavior of strataframe control? Does Strataframe add any code in event functions? Is there any better way to do it? Does Strataframe provide any hook method like before display, after display?&lt;/FONT&gt;</description><pubDate>Tue, 04 Jul 2006 01:15:04 GMT</pubDate><dc:creator>Wang Tong Yin</dc:creator></item><item><title>RE: Use Control Inherits From StrataFrame Library</title><link>http://forum.strataframe.net/FindPost1711.aspx</link><description>Nope, no problems at all... have fun with that.&lt;/P&gt;&lt;P&gt;Also, if you need to create your own controls that are bindable to business objects in the framework, you only need to implement the IWebBusinessBindable interface on your control and use the source code for the TextBox or any of the other controls to see how to implement it (type editor attributes, extra code, etc.).</description><pubDate>Mon, 03 Jul 2006 10:08:41 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item></channel></rss>