473,386 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Can't get TagPrefix to work for custom Web control

Hi

I've created a new custom Web control. I have tried to customize the assembly attribute TagPrefix . However, each time I drag my custom control onto a form, it's TagPrefix is still "cc1". What am I missing here

My control is nested within two namespaces: for example, OuterNamespace and InnerNamespace. Taking that into account, the AssemblyInfo.cs of my custom control's solution contains the following additional lines

..
using System.Web.UI
..
[assembly: TagPrefix("OuterNamespace.InnerNamespace", "mas")
..

I build my custom control, add it to the VS Toolbox, and test it by dropping it on a form. Alas, instead of being prefixed by "mas", the control is still prefixed by "cc1". Any advice on this one

Thanks in advance
-Michael
Nov 18 '05 #1
1 1879
Michael,

I tested out both scenarios to make sure everything worked: I went to
http://msdn.microsoft.com/library/de...ebControls.asp
(watch the URL wrap) and followed the instructions for this so that I did
not miss anything, and I made things look like:

AssemblyInfo.cs

using System.Web.UI;
.....
[assembly: TagPrefix("CustomLabel", "mas")]
CustomLabel.cs

namespace CustomLabel
{
public class WebControlLibrary1 ....
}

and I did one with the namespace="CustomLabel.TestLabel" and [assembly:
TagPrefix("CustomLabel.TestLabel", "mas")] and everything works when I add
it to the toolbox and then drag it over to the IDE in VS.

Any more info that you could post like the @Register statement in the HTML
view of the IDE when you drag and drop it on the page?

HTH. Give me more info and I can see what else if available.

Ben Miller

--
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
"Michael Skelton" <an*******@discussions.microsoft.com> wrote in message
news:A1**********************************@microsof t.com...
Hi,

I've created a new custom Web control. I have tried to customize the assembly attribute TagPrefix . However, each time I drag my custom control
onto a form, it's TagPrefix is still "cc1". What am I missing here?
My control is nested within two namespaces: for example, OuterNamespace and InnerNamespace. Taking that into account, the AssemblyInfo.cs of my
custom control's solution contains the following additional lines:
...
using System.Web.UI;
...
[assembly: TagPrefix("OuterNamespace.InnerNamespace", "mas")]
...

I build my custom control, add it to the VS Toolbox, and test it by dropping it on a form. Alas, instead of being prefixed by "mas", the control
is still prefixed by "cc1". Any advice on this one?
Thanks in advance,
-Michael

Nov 18 '05 #2

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

Similar topics

5
by: Showjumper | last post by:
I cannot get the custom Tag Prefix to work in controls made w/ VBNET. Why??? It works just fine in controls made w/ c#. Is vbnet just buggy?
11
by: Tom | last post by:
Hi all, I posted the same question one week ago in http://communities.microsoft.com/newsgroups/previewFrame.as p? ICP=msdn&sLCID=us&sgroupURL=microsoft.public.dotnet.framewo...
1
by: Bob | last post by:
When putting a custom-made control on the aspx page, it needs a <%@ Register TagPrefix="mymy" Namespace="myNS" Assembly="myAssembly" %> directive. Is there a way to register the tag once...
0
by: G Dean Blake | last post by:
( I know this should be posted in the BuildingControls forum but I don't get much help over there) I'm going through this book on asp.net server control development. I wrote a control using the...
2
by: Keith Harris | last post by:
When you drag a web user control onto your design surface, VS.NET automatically assigns the tagprefix = uc1. Does anyone know how to change the default tagprefix for all web controls you drag...
2
by: Frank | last post by:
From: "Frank" <fkaesser@pfmail.com> Subject: Can I Use HTML Text Writer i a Custom Control to Render the <head> Section? Date: Wednesday, January 18, 2006 11:38 AM I would like to create a...
6
by: Dariusz Tomon | last post by:
Hi How can I get url of page so taht I can pass it to string varaible. I have got several urls in my IIS under one folder. I want to have one default.aspx where code under it recognize which...
3
by: ahuja.madhur | last post by:
Hello I am creating a ASP.net 2.0 webpart for use in an aspx just for learning purpose. My webpart code is very simple : Now when I use this webpart DLL as a reference in website project and...
0
by: Sergei Shelukhin | last post by:
We have a custom (ascx) control that is used in several pages. In ASP.NET 1.1, we had register tagprefix specified in every page that uses this control; in 2.0, I decided to add this control to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.