Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Dynamically Added User Control

Reply
Thread Tools

Dynamically Added User Control

 
 
Jenni.Haughton@googlemail.com
Guest
Posts: n/a
 
      06-08-2007
I have a solution with 2 projects in it. I need to programatically
add a user control from one project into the other one (as you cannot
declare this normally on the form because it is in a different
application). When the page_load event of the user control is fired at
run-time, none of the form objects on the user control exist.

Is this a namespace issue? Or can you just not share a user control
over 2 projects without having a copy in both projects.

Thanks,
Jenni

 
Reply With Quote
 
 
 
 
Lloyd Sheen
Guest
Posts: n/a
 
      06-08-2007

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>I have a solution with 2 projects in it. I need to programatically
> add a user control from one project into the other one (as you cannot
> declare this normally on the form because it is in a different
> application). When the page_load event of the user control is fired at
> run-time, none of the form objects on the user control exist.
>
> Is this a namespace issue? Or can you just not share a user control
> over 2 projects without having a copy in both projects.
>
> Thanks,
> Jenni
>


This should be easy. I would create a third project for the usercontrol.
Then from each of the other projects either reference the usercontrol
assembly or the usercontrol project depending on the level of debugging you
are doing. Then when the usercontrol has changes the other two projects
will automatically pick up the new version (if you open the projects and
build the project).

Hope this helps,
Lloyd Sheen

 
Reply With Quote
 
 
 
 
Jenni.Haughton@googlemail.com
Guest
Posts: n/a
 
      06-08-2007
Thanks for the post.
The trouble is accessing the user control once it is in a seperate
project. I can reference it ok, but at run-time the control within
the user control do not exist.

Thanks,
Jen

 
Reply With Quote
 
Lloyd Sheen
Guest
Posts: n/a
 
      06-08-2007

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Thanks for the post.
> The trouble is accessing the user control once it is in a seperate
> project. I can reference it ok, but at run-time the control within
> the user control do not exist.
>
> Thanks,
> Jen
>

Do you mean that you have multiple controls within your usercontrol?

If so you must provide the method of accessing the controls. This can be
done with functions or readonly properties.

Hope this helps
Lloyd Sheen

 
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
Dynamically added user control Chris ASP .Net 9 04-01-2007 06:34 PM
Dynamically added user control throws object not set andyrich_1@hotmail.com ASP .Net 1 01-03-2006 01:58 PM
reference web control in dynamically added user control, ASP.NET 2 =?Utf-8?B?U2FtdWVs?= ASP .Net 7 08-10-2005 02:12 AM
Handle Event of Dynamically Added User Control Jon B ASP .Net 5 04-30-2005 12:33 PM
how come user control added to page doesn't get added to codebehind file? Bennett Haselton ASP .Net 1 11-08-2004 09:26 PM



Advertisments