How do I pass an object to webcontrol that is loaded using the "LoadLontrol" method ? .NET 2005 Beta

Discussion in 'ASP .Net Building Controls' started by Da Rabit, Feb 4, 2005.

  1. Da Rabit

    Da Rabit Guest

    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.CompilerGlobalScopeAttribute()]

    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(typeof(global::ctlWorkflowSetup_ascx));

    global::ctlWorkflowSetup_ascx.@__initialized = true;

    }

    }


    protected System.Web.Profile.DefaultHttpProfile Profile {

    get {

    return ((System.Web.Profile.DefaultHttpProfile)(this.Context.Profile));

    }

    }


    protected System.Web.HttpApplication ApplicationInstance {

    get {

    return ((System.Web.HttpApplication)(this.Context.ApplicationInstance));

    }

    }


    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);

    }

    }
    Da Rabit, Feb 4, 2005
    #1
    1. Advertising

  2. Da Rabit

    intrader Guest

    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.CompilerGlobalScopeAttribute()]
    >
    > 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(typeof(global::ctlWorkflowSetup_ascx));
    >
    > global::ctlWorkflowSetup_ascx.@__initialized = true;
    >
    > }
    >
    > }
    >
    >
    > protected System.Web.Profile.DefaultHttpProfile Profile {
    >
    > get {
    >
    > return ((System.Web.Profile.DefaultHttpProfile)(this.Context.Profile));
    >
    > }
    >
    > }
    >
    >
    > protected System.Web.HttpApplication ApplicationInstance {
    >
    > get {
    >
    > return ((System.Web.HttpApplication)(this.Context.ApplicationInstance));
    >
    > }
    >
    > }
    >
    >
    > 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.
    intrader, Feb 17, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Juan Irigoyen
    Replies:
    0
    Views:
    334
    Juan Irigoyen
    Sep 7, 2004
  2. Matt Howeson
    Replies:
    0
    Views:
    1,731
    Matt Howeson
    Mar 18, 2005
  3. =?Utf-8?B?Sm9obiBCYWlsZXk=?=

    Posting VS 2005 RC code to VS 2005 Beta 2 site

    =?Utf-8?B?Sm9obiBCYWlsZXk=?=, Oct 5, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    387
    =?Utf-8?B?Sm9obiBCYWlsZXk=?=
    Oct 5, 2005
  4. Pavan
    Replies:
    1
    Views:
    367
    Paul Glavich [MVP ASP.NET]
    Jul 14, 2005
  5. Da Rabit
    Replies:
    1
    Views:
    99
    Da Rabit
    Feb 4, 2005
Loading...

Share This Page