On Fri, 04 Feb 2005 09:42:35 +0200, Da Rabit wrote:
> Hi all,
> Because of the nature of my application, I have a web control that is being
> loaded and added to my form at runtime using the LoadControl method.
> Beacuse of the new framework, it is impossible to inherit from my own
> version of the "System.Web.UI.UserControl" class as the code seems to be
> created during the compile ! "Thanks again for the black box programming MS
> !!!"
> My questions are ...
> 1) Is there a way to pass an object to my control after I have created it
> ...
> 2) Is there a way to change the web control to inherit from anything other
> then the "System.Web.UI.UserControl" class that is being inherited for a
> webcontrol in 2005 ?
>
>
>
> This is an example of the code that is generated by .NET, I need to change
> the System.Web.UI.UserControl inheritance !
>
>
>
>
>
> #pragma checksum "E:\Local Files\Vss\Product Development and
> Delivery\Project Office Projects\P0014 2004 Dot Net
> ReWrite\BISMOD\SOURCE\Website\COR\LAYOUT\Controls\ ctlWorkflowSetup.ascx"
> "{406ea660-64cf-4c82-b6f0-42d48172a799}" "512CD8579573A7626409E82582B67450"
>
> //------------------------------------------------------------------------------
>
> // <autogenerated>
>
> // This code was generated by a tool.
>
> // Runtime Version:2.0.40607.16
>
> //
>
> // Changes to this file may cause incorrect behavior and will be lost if
>
> // the code is regenerated.
>
> // </autogenerated>
>
> //------------------------------------------------------------------------------
>
> using System;
>
> using System.Collections;
>
> using System.Collections.Specialized;
>
> using System.Configuration;
>
> using System.Text;
>
> using System.Text.RegularExpressions;
>
> using System.Web;
>
> using System.Web.Caching;
>
> using System.Web.Profile;
>
> using System.Web.Security;
>
> using System.Web.SessionState;
>
> using System.Web.UI;
>
> using System.Web.UI.HtmlControls;
>
> using System.Web.UI.Imaging;
>
> using System.Web.UI.WebControls;
>
> using System.Web.UI.WebControls.WebParts;
>
>
>
>
>
> [System.Runtime.CompilerServices.CompilerGlobalScop eAttribute()]
>
> public partial class ctlWorkflowSetup_ascx : System.Web.UI.UserControl {
>
>
> private static bool @__initialized = false;
>
>
> private static object @__stringResource;
>
>
> public ctlWorkflowSetup_ascx() {
>
> AppRelativeVirtualPath = "~/COR/LAYOUT/Controls/ctlWorkflowSetup.ascx";
>
> if ((global::ctlWorkflowSetup_ascx.@__initialized == false)) {
>
> global::ctlWorkflowSetup_ascx.@__stringResource =
> System.Web.UI.TemplateControl.ReadStringResource(t ypeof(global::ctlWorkflowSetup_ascx));
>
> global::ctlWorkflowSetup_ascx.@__initialized = true;
>
> }
>
> }
>
>
> protected System.Web.Profile.DefaultHttpProfile Profile {
>
> get {
>
> return ((System.Web.Profile.DefaultHttpProfile)(this.Cont ext.Profile));
>
> }
>
> }
>
>
> protected System.Web.HttpApplication ApplicationInstance {
>
> get {
>
> return ((System.Web.HttpApplication)(this.Context.Applica tionInstance));
>
> }
>
> }
>
>
> public override string AppRelativeTemplateSourceDirectory {
>
> get {
>
> return "~/COR/LAYOUT/Controls";
>
> }
>
> }
>
>
> private void @__BuildControlTree(ctlWorkflowSetup_ascx @__ctrl) {
>
> }
>
>
> protected override void FrameworkInitialize() {
>
> base.FrameworkInitialize();
>
> SetStringResourcePointer(global::ctlWorkflowSetup_ ascx.@__stringResource,
> 0);
>
> this.@__BuildControlTree(this);
>
> }
>
> }
All kind of things are possible using reflection and dynamic loading.
|