|
 |
aspx_beginners thread: Tag prefix and Namespace
Message #1 by "F-J Mattmann" <f-j.mattmann@e...> on Thu, 4 Jul 2002 10:57:31
|
|
Hi
I have 2 .dll -test1.dll
-test2.dll
they both have the same namespace: testspace
I want to use both with the SAME PREFIX from my .ASPX like this:
<%@ Register TagPrefix = "FJM" Namespace = "testspace" Assembly="test1"%>
<%@ Register TagPrefix = "FJM" Namespace = "testspace" Assembly="test2"%>
<FJM:FJMTest1 id = "control1" runat="server"/>
<FJM:FJMTest2 id = "control2" runat="server"/>
-------
It doesn´t work because I obviously have to register 2 different Tag-
prefixes like: FJM & FJM2
- How shall I proceed to be able to use the same TAG?
ASP:NET uses only <ASP: for all its controls!
- How shall I proceed to have several controls with the same Space-name
and call them with the same Tag-prefix?
- Can ´t I have a big .DLL containing several controls?
Thanks
Message #2 by "Chadrick" <chadm@d...> on Thu, 4 Jul 2002 09:07:00 -0400
|
|
<FJM:Test1 id =3D "control1" runat=3D"server"/>
<FJM:Test2 id =3D "control2" runat=3D"server"/>
Though I have never done this before all the examples in my books have
it like the above instead of like:
<FJM:FJMTest1 id =3D "control1" runat=3D"server"/>
<FJM:FJMTest2 id =3D "control2" runat=3D"server"/>
If I'm wrong than let me know so I don't run into the same problem in
the future...
-----Original Message-----
From: F-J Mattmann [mailto:f-j.mattmann@e...]
Sent: Thursday, July 04, 2002 10:58 AM
To: aspx_beginners
Subject: [aspx_beginners] Tag prefix and Namespace
Hi
I have 2 .dll -test1.dll
-test2.dll
they both have the same namespace: testspace
I want to use both with the SAME PREFIX from my .ASPX like this:
<%@ Register TagPrefix =3D "FJM" Namespace =3D "testspace"
Assembly=3D"test1"%>
<%@ Register TagPrefix =3D "FJM" Namespace =3D "testspace"
Assembly=3D"test2"%>
<FJM:FJMTest1 id =3D "control1" runat=3D"server"/>
<FJM:FJMTest2 id =3D "control2" runat=3D"server"/>
-------
It doesn=B4t work because I obviously have to register 2 different Tag-
prefixes like: FJM & FJM2
- How shall I proceed to be able to use the same TAG?
ASP:NET uses only <ASP: for all its controls!
- How shall I proceed to have several controls with the same Space-name
and call them with the same Tag-prefix?
- Can =B4t I have a big .DLL containing several controls?
Thanks
Message #3 by "F-J Mattmann" <f-j.mattmann@e...> on Fri, 5 Jul 2002 06:43:11
|
|
Hi, Thank you for your reply but it doen´nt work.
The result is no complain any more but nothing appears on the screen (only
my HTML code from .ASPX but nothing from my controlls.
regards
Message #4 by "F-J Mattmann" <f-j.mattmann@e...> on Mon, 8 Jul 2002 07:02:44
|
|
I have the answer:
If I want to use the same Tag-prefix, I do have to put all my controls in
the same assembly file (.DLL)
such as in exempel below:
-----------------------------------------------------
imports System
imports System.Web
imports System.Web.UI
Namespace FJMSpace
Public Class FJMTest1 : Inherits Control
protected Overrides Sub Render(Output as HtmlTextWriter)
Output.Write("Det här är min anpassade kontroll
nr. 1, klockan är nu " & DateTime.Now.ToString("T"))
End Sub
End Class
Public Class FJMTest2 : Inherits Control
protected Overrides Sub Render(Output as HtmlTextWriter)
Output.Write("Det här är min anpassade kontroll
nr. 1, klockan är nu " & DateTime.Now.ToString("T"))
End Sub
End Class
end Namespace
|
|
 |