"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