Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: why I couldn't name my costomed server control???


Message #1 by "zhangxingliang" <zhangxingliang@s...> on Sat, 13 Apr 2002 08:42:45
  I define my server control like this.
    
  namespace servercontrol_test   
     Public Class xlzhang
        Inherits Control
        Implements INamingContainer
        Implements IPostBackDataHandler

        Private __id As String

        'I want to name my control,use ID property below
        Public Overrides Property ID() As String
            Get
                Return __id
            End Get
            Set(ByVal Value As String)
                __id = Value
            End Set
        End Property 

     ......
     end class 
  end namespace


I declare this control in my ASP.Net pages like this.
       
  ......
  <%@ register tagprefix="test" namespace="servercontrol_test" 
assembly="CodeFile1"%>
  ......
  
  		<form id="Form1" method="post" runat="server">
			<test:xlzhang id="zxl" 
runat="server"></test:xlzhang>
                </fom>
  ......


But,when I declare my control in asp.net pages,the conpiler 
said "Ambiguous match found",
 and the row "<test:xlzhang id="zxl" runat="server"></test:xlzhang>" is 
marked red.

  Return to Index