Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > How do I pass an object to webcontrol that is loaded using the "LoadLontrol" method ? .NET 2005 Beta.

Reply
Thread Tools

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

 
 
Da Rabit
Guest
Posts: n/a
 
      02-04-2005
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);

}

}



 
Reply With Quote
 
 
 
 
intrader
Guest
Posts: n/a
 
      02-17-2005
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
Usercontrol dynamically loaded (in Init method of webcontrol) have viewstate problems Matt Howeson ASP .Net 0 03-18-2005 09:24 PM
How do I pass an object to webcontrol that is loaded using the "LoadLontrol" method ? .NET 2005 Beta. Da Rabit ASP .Net Web Controls 1 02-04-2005 07:38 AM
Re: how to programatically give assembly loaded from network the same trust as those loaded from local host? Marcelo Birnbach [MS] ASP .Net 0 06-27-2003 11:51 PM



Advertisments