DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Fri, 20 Jul 2007 10:46:07 -0700,    posted on: microsoft.public.dotnet.framework.aspnet.webcontrols        back       

Thread Index
  1    Mike Owen am


Adding and populating a custom property for a user control   
I have built and used a custom control which works fine.

I now want to add a property that I can set from the various pages where I 
use the control.

I have added the following property in the code behind file:

       Public Property ContentTypeID() As Int16
            Get

                Return mContentTypeID

            End Get
            Set(ByVal value As Int16)

                mContentTypeID = value

            End Set
        End Property

and set it in the page as follows:

<%@ Register TagPrefix="uc1" TagName="_Content" Src="~/_Content.ascx" %>
<uc1:_Content id=_Content ContentTypeID=10  runat="server"></uc1:_Content>

However in design time the error 'Attribute ContentTypeID is not a valid 
attribute of element _Content' comes up for the property/attribute 
ContentTypeID, and of course the value of 10 is not passed through to the 
code behind file.

Any ideas what I am doing wrong?


Thanks, Mike.
Date:Fri, 20 Jul 2007 10:46:07 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us