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;
Me too me too.
Tiernan O'toole might have an invite for me http://blog.lotas-smartman.net/
Not long after posting, I got a offer of an invitation from Frank Levigne ( http://www.franksworld.com/ )
The “thank you” deserves a post of it own, but I wouldn't want annother comment from matthew.
Thanks again FRank
This page is #2 on google for g mail with a space... just after gmail.
I keep having to search for this so I am adding it here
Adding Design-Time Support to ASP.NET Controls
G. Andrew Duthie