473,625 Members | 3,210 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Share User Control Across Applications - How?

Hey everyone,

Ok. I have a "template and skin" setup on the beginnings of a new portal
site. In this site, there are going to be many applications, which will be
store underneath the "master" site. How can I share the template user
controls with these "sub-applications"?

Example:

Root
|
| -> Per article from Microsoft's website, 825996, I have setup a
virtual directory that points to the "common" folder, named
"intranet_commo n_folder".
| -> Secure Portal Site Folder (say, intranet)
|
| -> Common (a common place to put all my template controls and
other "app-sharing controls"
|-> Some Class or .ascx file or .asp file, etc
| -> WebApplication1 (uses a .ascx file from Common)
| -> WebApplication2 (uses a .ascx file from Common)

Ideas? I've tried the virtual directory approach, but that doesn't work, I
get "The virtual path
'/intranet_common _folder/themes/06_01_2004/site_theme/site_template.a scx'
maps to another application, which is not allowed.". Since I will not have
access to the GAC, and I don't want to have our Admin have to publish to the
GAC, how can I do this?

Thanks for any and all help!

Chad
Nov 18 '05 #1
3 1444
"Chad A. Beckner" <Ch*********@Pr ospectiveLink.c om> wrote in message
news:ez******** ******@TK2MSFTN GP11.phx.gbl...
Hey everyone,

Ok. I have a "template and skin" setup on the beginnings of a new portal site. In this site, there are going to be many applications, which will be store underneath the "master" site. How can I share the template user
controls with these "sub-applications"?


This can be tricky, as User Controls aren't really meant to work this way.
Microsoft seems to have intended anything sophisticated like this to be done
with Custom Controls.
--
John Saunders
johnwsaundersii i at hotmail
Nov 18 '05 #2
Hey John (hehe, do you live on this newgroup?! hehe)...

Anyways, do you mean, .vb class files? I have those, and those seem to be
working. BUT, they do "reference" the site template file, which is an .ascx
file. Do I need to digitially sign it for it to work? I don't want to put
it into the GAC, that's not an option. Basically, I guess, can you point me
in a direction for custom controls and those that load an .ascx (or
whatever) from a folder that is not part of the current application?

Thanks John!

Chad

"John Saunders" <jo************ **@notcoldmail. com> wrote in message
news:uQ******** *****@TK2MSFTNG P11.phx.gbl...
"Chad A. Beckner" <Ch*********@Pr ospectiveLink.c om> wrote in message
news:ez******** ******@TK2MSFTN GP11.phx.gbl...
Hey everyone,

Ok. I have a "template and skin" setup on the beginnings of a new portal
site. In this site, there are going to be many applications, which will

be
store underneath the "master" site. How can I share the template user
controls with these "sub-applications"?


This can be tricky, as User Controls aren't really meant to work this way.
Microsoft seems to have intended anything sophisticated like this to be

done with Custom Controls.
--
John Saunders
johnwsaundersii i at hotmail

Nov 18 '05 #3
"Chad A. Beckner" <Ch*********@Pr ospectiveLink.c om> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Hey John (hehe, do you live on this newgroup?! hehe)...
No. I spend the rest of my time online looking for work...
Anyways, do you mean, .vb class files? I have those, and those seem to be
working. BUT, they do "reference" the site template file, which is an ..ascx file. Do I need to digitially sign it for it to work?
No, that's got nothing to do with it.
I don't want to put
it into the GAC, that's not an option. Basically, I guess, can you point me in a direction for custom controls and those that load an .ascx (or
whatever) from a folder that is not part of the current application?


The issue with user controls is that they were meant to be a simple
mechanism for creating common content. But "simple" includes some
restrictions. The fact that you can't easily share them between sites is one
of those limitations.

I'll give you some references to documentation on custom controls:

ASP.NET Server Control Development Basics
(http://msdn.microsoft.com/library/de...-us/cpguide/ht
ml/cpconwebformsco ntroldevelopmen tbasics.asp)

Developing a Composite Control
(http://msdn.microsoft.com/library/de...-us/cpguide/ht
ml/cpcondeveloping compositecontro ls.asp)

Before this scares you away, I'll tell you that it's fairly easy to create a
custom control to duplicate the functionality of a user control. The
"Composite Control" article talks about the sort of control you'll need. For
the most part, all you'll need to do is to override the CreateChildCont rols
method, instantiate and initialize each of your child controls and add them
to the Controls collection. That way, you don't even need to worry about
rendering the control - the child controls will do that for you:

<%@ Control Language="vb" AutoEventWireup ="false" Codebehind="uc. ascx.vb"
Inherits="ns.uc "
TargetSchema="h ttp://schemas.microso ft.com/intellisense/ie5" %>
<asp:Label runat="server" Text="User:" /><asp:TextBox runat="server"
id="txtUser"/><br>
<asp:Label runat="server" Text="Password: "/><asp:TextBox runat="server"
id="txtPassword "/><br>
translates into:

Protected Overrides Sub CreateChildCont rols()
Dim lblUser As New Label()
lblUser.Text = "User:"
Controls.Add(lb lUser)

Dim txtUser as New TextBox()
txtUser.Id = "txtUser"
Controls.Add(tx tUser)

Dim lblPassword as New Label()
lblPassword.Tex t = "Password:"
Controls.Add(lb lPassword)

Dim txtPassword as New TextBox()
txtPassword.Id = "txtPasswor d"
Controls.Add(tx tPassword)

MyBase.CreateCh ildControls()
End Sub

Not a real big deal.
--
John Saunders
johnwsaundersii i at hotmail
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3465
by: George Hester | last post by:
In one Application (2) the client is redirected to a Logon ASP in a different Application (1). A Session Variable is made in Application 2 which needs to be recognized in Application 1. Can I do that in Windows 2000 SP3 IIS5 no .NET Framework? Thanks. -- George Hester __________________________________
1
1321
by: mg | last post by:
I took the following steps to share a user control across applications but was unsuccessful. WebUserControl: <%@ Control Language="c#" AutoEventWireup="false" ClassName="WebUserControl1" %> -----------------------------------------
3
1472
by: Jon Paugh | last post by:
Hi, If I have several aspx pages that I want to share across multiple web applications, how would I organize them? Basically, a subset of the pages on a given site will be on several sites. These pages will interact with a database, check security, etc. I have seen this KB article: http://support.microsoft.com/default.aspx?kbid=324785
5
3150
by: Marcel Gelijk | last post by:
Hi, I am trying to create a User Control that is located in a seperate class library. The User Control contains a textbox and a button. The page generates an exception when it tries to access the code variable that are supposed to be linked to the contained controls. It runs fines when everything is contained in a single web form project. What do I need to do to make it work from a class library?
2
1774
by: Eric | last post by:
I have a header server(.ascx) control that I want to use with all my existing seperate web apps. These web apps are configured as seperate web apps in IIS but when I try to build my solutiuon referencing an ..ascx that lives outside the application I get a failure. Is there any way to have a global ascx file that multiple seperate applications can use? Thanks
4
1446
by: dx | last post by:
I have 3 vb.net web applications. I would like all 3 to have access to a library of user controls. server controls wouldn't cause a problem but these are user controls (ascx.) From each solution I reference the user control library project and create a virtual directory under each applicatoin that links to the folder that contains the ascx files but I get a runtime error like: Description: An error occurred during the parsing of a...
5
1465
by: Craig HB | last post by:
I have 2 asp.net applications : a Stock Control application and a Reporting application. They are separate applications in IIS 6 and developed as separate projects in visual studio.net. When the user first goes into the Stock Control app, he needs to log in. When he goes from the Stock Control app to the Reporting app, his User ID needs to get transfered across so the Reporting app knows who the user is (without asking him to log in...
5
5086
by: Raed Sawalha | last post by:
We have a web application with at least 570 Pages and 10's of user controls ....all under project name LinkDevProject ...recently we start separating the project into multiple projects ....the problem we have in user controls how to share them without duplicate the control in each project ....we need to remain the controls in main project and all subproject use them .....what is the avaiable technique to achieve this?
6
2960
by: tendim | last post by:
G'day group. Currently our organization us using VB6 based applications, and I am trying to push forward and migrate some of the smaller things to VB.NET, eventually migrating all applications from VB6 and other legacy languages/systems (Pure VBScript, DataEase, etc.) over to .NET. Currently, *all* user data is stored on network shares. When a user logs in to a workstation, their home drive is mounted from one share, all of their...
0
8696
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8637
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8358
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7188
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5571
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4195
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.