I've implemented a simple extender following the example here.
I've used a string property instead of the CultureInfo from the example. When I change the value on the design surface, the SetXX method is called with the correct control, but when I look at the code that is serialized into InitializeComponent it uses "this" which is the page, rather than "this.Label1".
I am wondering if there is a better example of an extender with WebControls, if I am doing something silly, if it would work if I were at work and using VS 2003 instead of being at home with VS 2002, how many people are gonna blast me for posting this here instead of in some newsgroup where 12 people will aske me if this has answered my question ;)
public class WebControlExtender :Control, IExtenderProvider
public bool CanExtend(object target)
return (target is Control);
private string _testString ="";
public string GetLocalizationKey(Control control)
public void SetLocalizationKey(Control control,string value)
_testString = value;
I'm saving to the html attributes for now.
I would really like to save property values I add to a WebControl into the resx the same way that properties I add to a component are saved.
public void SetQuestionID(WebControl control,string value)
if(value.Length >0 )
control.Attributes[AttributeQuestionID] = value;