I have a custom control which is a combination of textbox and button (a search control). One of its attribute defined is used to identify its position (whether in Master or Content page so that we make the search settings) that is PageName. Initially this was declared as string property as:
public string PageName
{
set;
get;
}
But since we had some issues with case sensitivity. We changed this as enum, so that users will not enter any random things avoiding the exceptions. So this is now changed to:
public enum PageNameProperty { MasterPage , SearchResultsPage, MLIPage };
public PageNameProperty PageName
{
set;
get;
}
But now we are getting the error as :
Method not found:’Void UI.SearchTextBox.set_PageName(System.String)’.
Inner Exception (Level 1)
Note: Now i cannot force users to change this to PageName.Master or anything else, since they cannot modify the code for current release but can only install our control, so the projects would refer the new DLLs.
I need some solution apart from replicating the property type back to string before the current release.
Please help.
You changed the signature (return type for instance) of a property. Calling code will fail as they won’t find the signature they are expected.
You should keep the original property, mark it as obsolete, and create a new one like this :
This will keep compatibility with former use, while incitating the use of the new one.