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
Set(ByVal value As Int16)
mContentTypeID = value
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?
|All times are GMT. The time now is 07:53 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.