Designating A TagPrefix

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to define a controls tagprefix in the control itself? When I drop a control on a web page it's tagprefix defaults to uc1, as expected. Where can I set it so that it's default tag prefix is something else, so i don't have to change 'em every time I drop a control on the form? Thanks.

Jerry
 
Is there a way to define a controls tagprefix in the control itself? When I
drop a control on a web page it's tagprefix defaults to uc1, as expected.
Where can I set it so that it's default tag prefix is something else, so i
don't have to change 'em every time I drop a control on the form? Thanks.

Jerry




Jerry,

Not sure about 2005, but in 2003 you would use an assembly attribute named
TagPrefix which is under the System.Web.UI namespace (IE: <Assembly:
System.Web.UI.TagPrefix("MyNamespaceHere", "MyPrefix")

HTH,
Mythran
 
Hello Jerry,

I think the "System.Web.UI.TagPrefixAttribute" class Mythran mentioned is
what you want. You can specify the tagprefix for controls under a certain
namespace in your assemby. e.g.

================
[assembly: TagPrefix("URLSiteLib", "urlsitelib")]

namespace URLSiteLib
{
[DefaultProperty("Text")]
[ToolboxData("<{0}:MyControl1 runat=server></{0}:MyControl1>")]
public class MyControl1 : WebControl
{
................

================

#TagPrefixAttribute Class
http://msdn2.microsoft.com/en-us/library/system.web.ui.tagprefixattribute.as
px

BTW, use the default randomly generated control prefix can ensure that your
tagprefix won't conflict with other class library's controls.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hello Jerry,

Does the suggestion in the previous reply helps? If there is still anything
we can help, please feel free to let me know.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Probably.. Actually just haven't had the time to play with it. But it
looks like the right place to go.
 

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

Back
Top