TagPrefixAttribute Question

G

G Dean Blake

I'm going through this book on asp.net server control development. I wrote
a control using the namespace:

ESS.ServerControls

The book says that if I put the following in my control's AssemblyInfo.vb
file that my controls will be prefixed by an "ess" tagPrefix:

Imports System.Web.UI
..
..
<Assembly: TagPrefix("ESS.ServerControls", "ess")>

But it does not work. When my control gets dragged onto an aspx page, a
TagPrefix of "cc1" gets generated.

Anyone know what is wrong?
Thanks
G.
 
J

John Saunders

G Dean Blake said:
I'm going through this book on asp.net server control development. I
wrote a control using the namespace:

ESS.ServerControls

The book says that if I put the following in my control's AssemblyInfo.vb
file that my controls will be prefixed by an "ess" tagPrefix:

Imports System.Web.UI
.
.
<Assembly: TagPrefix("ESS.ServerControls", "ess")>

But it does not work. When my control gets dragged onto an aspx page, a
TagPrefix of "cc1" gets generated.

Anyone know what is wrong?

I don't know if this is it, but the example from the MSDN documentation
(from VS2005 Beta 1) is:

Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls

<assembly: TagPrefix("CustomControls", "custom")> _

Namespace CustomControls

' Simple custom control
Public Class MyVB_Control
Inherits Control
Private message As String = "Hello"

Public Property getMessage() As String
Get
Return message
End Get
Set (ByVal value As String)
message = value
End Set
End Property

<System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.Demand,
Name:="FullTrust")> _
Protected Overrides Sub Render(writer As HtmlTextWriter)
writer.Write(("<span style='background-color:aqua; font:8pt tahoma,
verdana;'> " + Me.getMessage + "<br>" + "VB version. The time on the server
is " + System.DateTime.Now.ToLongTimeString() + "</span>"))
End Sub 'Render
End Class 'MyControl
End Namespace 'CustomControls


John Saunders
 
G

G Dean Blake

The difference seems to be that those docs have me putting the TagPrefix
assembly directive in the source to the control itself instead of in the
AssemblyInfo file. I tried it and still got the same thing cc1.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,263
Messages
2,571,064
Members
48,769
Latest member
Clifft

Latest Threads

Top