How to customize the TagPrefix of a Web server control instead of appearing cc1

Source: Internet
Author: User
Tags tagname
Web|web Service |web Server | control
I have not noticed this problem before, that is, I wrote the ASP.net server control, that is, Web Custom controls. Dragging a control onto the page will have the following markings:

<cc1:exlistbox id= "ExListBox1" runat= "Server" > </cc1:ExListBox>

There is also a syntax identifier for the page header

<%@ Register tagprefix= "cc1" namespace= "Namespace" assembly= "Assembly"%>

If you modify the cc1 here to the ideal tagname, then drag the corresponding control under the namespace, and then start with tagname.

However, perhaps in the Web control code to set up, it should not be so troublesome, but also to page changes. That is, you need to use the TagPrefix attribute. As shown below:

[Assembly:tagprefix ("CustomControls", "Custom")]
Namespace CustomControls
{
Simple custom Control
public class Exlistbox:control
{
//....
}

CustomControls refers to the namespace, custom refers to the tagname that you want to use

Reference: MSDN TagPrefix Property

Link: http://www.ftponline.com/vsm/2003_08/magazine/columns/aspnet/


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.