Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   Adding and populating a custom property for a user control (http://www.velocityreviews.com/forums/t780042-adding-and-populating-a-custom-property-for-a-user-control.html)

Mike Owen 07-20-2007 05:46 PM

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.


All times are GMT. The time now is 01:34 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.