473,797 Members | 2,970 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("Oute rNamespace.Inne rNamespace", "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 1914
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("Cust omLabel", "mas")]
CustomLabel.cs

namespace CustomLabel
{
public class WebControlLibra ry1 ....
}

and I did one with the namespace="Cust omLabel.TestLab el" and [assembly:
TagPrefix("Cust omLabel.TestLab el", "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*******@disc ussions.microso ft.com> wrote in message
news:A1******** *************** ***********@mic rosoft.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("Oute rNamespace.Inne rNamespace", "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
2124
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
1252
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 rk.aspnet&sMessageID=%253C7d8d01c3b4a1%2524412f7770% 2524a601280a@phx.gbl%253E The problem has not fixed till now.
1
1111
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 somewhere in the app (the config file?) so no need to write this in each and every aspx file?
0
949
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 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:
2
3702
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 onto a web form? Thank you.
2
529
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 custom control that generates everything that will be in the <head> </head> section. This would allow me to make changes on all pages withing a site in one location.
6
29655
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 url is used by user and then display appropriate data to that url (one url is about fashion, other about law and so on). By means of recognition of url I can display appropriate banners for example.
3
2944
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 include this line <%@ Register TagPrefix="custom" Namespace="aspwebpart" %>
0
986
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 one more page so I added tagprefix registration to web.config. However, when I tried to open the page (after building the app ofc) it gave me errors in control's page_load - all of its inner controls (textboxes etc) were nulls. As soon as I copy...
0
9536
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10468
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...
1
10205
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
10021
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
6802
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
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4131
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.