MetaBuilders.ComboBox compile with Visual Studio 2005

I am using  MetaBuilders.ComboBox[^] (see my previos posts here and here) and now compiled it with VS 2005.New compiler is more strict .

It showed couple compiler errors “Cannot access protected member 'System.Web.UI.WebControls.WebControl.WebControl()' via a qualifier of type 'System.Web.UI.WebControls.WebControl'; the qualifier must be of type 'MetaBuilders.WebControls.ComboBox' (or derived from it)“ for code lines
container = new WebControl(); and
button = new WebControl();

Fortunately the fix is simple -  add HtmlTextWriterTag.Span parameter as the following:

container = new WebControl(HtmlTextWriterTag.Span);

button = new WebControl(HtmlTextWriterTag.Span);

posted @ Friday, March 24, 2006 10:06 AM

Print

Comments on this entry:

# re: MetaBuilders.ComboBox compile with Visual Studio 2005

Left by Vandan at 8/20/2006 10:44 PM
Gravatar
Hey this thing worked...
thanks for the fix...
any reason why it failed if we didnt put the HtmlTextWriterTag.Span??

# re: MetaBuilders.ComboBox compile with Visual Studio 2005

Left by Michael Freidgeim at 8/21/2006 8:21 AM
Gravatar
"reason why it failed" is that MS .Net 2.0 compiler is more strict and now reports errors about access to protected constructor( Compiler Error CS1540 -http://msdn2.microsoft.com/en-us/library/s9zta243.aspx )that were not reported in .Net 1.1

Your comment:



 (will not be displayed)


 
 
 
Please add 2 and 5 and type the answer here:
 

Live Comment Preview:

 
«October»
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678