| | | StrataFrame Beginner
       
Group: Forum Members Last Login: 07/18/2006 7:59:33 PM Posts: 25, Visits: 46 |
| | Can I use my own control, which inherits from StrataFrame library? For example, I define a class called 'Textbox' as below: Public Class Textbox Inherits MicroFour.StrataFrame.UI.Web.TextBox . . . End Class Will it cause any errors when i try to add, update or delete record? |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: 12/02/2008 4:42:46 PM Posts: 2,686, Visits: 1,890 |
| | Nope, no problems at all... have fun with that. 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.).
www.bungie.net |
| | | | StrataFrame Beginner
       
Group: Forum Members Last Login: 07/18/2006 7:59:33 PM Posts: 25, Visits: 46 |
| | I try to change something on the web controls before displaying them. For example, the value of a textbox will be updated by a function before it shows out. Can I add my code in some event functions like Textbox_Init() and Textbox_Load() as shown below?Private Sub Textbox_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.InitEnd SubPrivate Sub Textbox_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadEnd Sub 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? |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: 12/02/2008 4:42:46 PM Posts: 2,686, Visits: 1,890 |
| | No, the web controls do not have any hooks for the databinding. 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. 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. Same thing goes for the Page.PreLoad event for copying data back from the control.
www.bungie.net |
| | | | StrataFrame Beginner
       
Group: Forum Members Last Login: 07/18/2006 7:59:33 PM Posts: 25, Visits: 46 |
| | 1. This means StrataFrame will update and modify the value of the controls in Page.PreLoad and Page.PreRender event? 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? 3. Page.Load and Page.PreRenderComplete are the safe places for me to add some codes? |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: 12/02/2008 4:42:46 PM Posts: 2,686, Visits: 1,890 |
| This means StrataFrame will update and modify the value of the controls in Page.PreLoad and Page.PreRender event? That is correct. 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? You could add code there. You should handle errors just like any other errors that appear within an ASP.NET page, including the custom error pages if necessary. Page.Load and Page.PreRenderComplete are the safe places for me to add some codes? Correct, those are the safest places to add code.
www.bungie.net |
| | | | StrataFrame Beginner
       
Group: Forum Members Last Login: 07/18/2006 7:59:33 PM Posts: 25, Visits: 46 |
| | 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? |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: 12/02/2008 4:42:46 PM Posts: 2,686, Visits: 1,890 |
| | When you override a method, you have to call MyBase.MethodName(). So, if you're overriding the OnPaint() method of a control, it would look like this: Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs) '-- Make the base method call (DODEFAULT()) MyBase.OnPaint(e) '-- Custom code here End SubNow, if you attach to an event, then there is no base or DODEFAULT that you need to call; it will be done automatically. In fact, there is no way to prevent the base methods from firing. Only on method overrides do you need to call the base method.
www.bungie.net |
| |
|
|