Re: Question Regarding Plugin Architecture

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have made some progress. What I am doing now, instead of
LoadControl, is I am creating a reference to the Assembly by using
Assembly.LoadFrom(). I then cast it to the correct control type and
assign it to the control collection of a placeholder on the calling
page. This is what I have in my Page_Load on the ASPX page:

Dim MyPlaceHolder As PlaceHolder =
CType(Me.FindControl("TemplateHolder"), PlaceHolder)

If Not MyPlaceHolder Is Nothing Then

Dim DynamicASM As [Assembly]
DynamicASM =
DynamicASM.LoadFrom(Server.MapPath("./New/bin/New.dll"))

Dim ControlInstance As MyLib.Page.Controls.Template =
CType(DynamicASM.CreateInstance("New.Index"),
MyLib.Page.Controls.Template)

MyPlaceHolder.Controls.Add(ControlInstance)

ControlInstance.TestOutput()

End If

The TestOutput() method is defined in the base control instance, and
outputs "Base" to the screen when called, if it is not overriden. I
override it in the derived instance to display "Derived". When I run
the above code, it displays "Derived". But now, my new problem...

Any content in the derived control is not displayed. For example, I
added a table in the designer and recompiled. The instance I create
from the assembly is displaying "Derived", so it is creating it. The
events of the derived control are also being hit correctly, if I add
breakpoints in the debugger. I just can't get the table to show. I am
assuming that something is happening in LoadControl that this approach
does not do.

Does anyone have any idea as to might what be going on, or have a
better approach to this? I am feeling a little lost at the moment.
;-)

Thanks!

Joseph

.



Relevant Pages

  • Re: SS_BITMAP Property
    ... display it? ... you can compute the width and height of the bitmap by using the ... point, you could use something like SetWindowPos to resize the static control, e.g., if ... Please some body explain how to override ...
    (microsoft.public.vc.mfc)
  • Re: Validating ComboBox Entries
    ... To prevent a user from entering any data, it can't be in the rowsource. ... still need to see it in the employees historical entries. ... the project name is displayed in the Combo control. ... I would have to display a Message Box or something similar to ...
    (microsoft.public.access.formscoding)
  • RE: VS2005 DataList with Nested GridView using ObjectDataSource
    ... you're wantting to display some data on the ASP.NET ... web page through the DataList control, and since those data records can ... category items in the DataList and in each DataList item, use a GridView ... | customer number in a grid (call it QUERY A). ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Synchronizing the Main form and six (6) subforms?
    ... you're going to need to control which controls/which subform to ... display. ... > shipment to the correct main record. ...
    (microsoft.public.access.formscoding)
  • Object creation
    ... I thought that I could easily copy a single Excel file from ... I've built my userform and got some of the code running. ... display the link names accordingly. ... range of 3 columns and then show that in my control. ...
    (microsoft.public.excel.programming)