Don't miss out Virtual Happy Hour today (April 26).

Try our conversational search powered by Generative AI!

Using PropertyControlClassFactory.RegisterClass

Vote:
 
I'm trying to adapt a property edit control by using PropertyControlClassFactory.Instance.RegisterClass to register my new control. This seems to work and my control is called instead. However, what I want to do is to determine what page type the property is being edited for, and I think I should be able to do that by using the PropertyData.PageDefinitionID to get the PageDefinition object which has a PageTypeID property. But the PropertyData.PageDefinitionID is always 0. Othe properties of the PropertyData object seem to be initialized properly. Isn't it possible to do this or am I doing it wrong?
#33032
Sep 30, 2009 10:48
Vote:
 

I think I found the problem. I'm trying to do this for one of the built-in properties, and they seem to lack the PageDefinitionID which seems fair.

Is there still a way to determine what page type the control is being loaded for?

Edit: One way (a bit ugly) is to add a dummy property to the page type and look for this property.

#33040
Edited, Sep 30, 2009 12:41
Vote:
 

You should be able to do;
((PageBase)base.Page),CurrentPage.PageTypeID

/johan

#33042
Sep 30, 2009 13:16
Vote:
 
Seems to work, thank you!
#33043
Sep 30, 2009 13:30
Vote:
 

Thanks

#41680
Jul 21, 2010 4:36
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.