Geeks With Blogs

News My Blog has been MOVED to https://mfreidge.wordpress.com
Michael Freidgeim's OLD Blog My Blog has been MOVED to https://mfreidge.wordpress.com

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 on Friday, March 24, 2006 10:06 AM ASP.NET , .Net Framework | Back to top


Comments on this post: MetaBuilders.ComboBox compile with Visual Studio 2005

# re: MetaBuilders.ComboBox compile with Visual Studio 2005
Requesting Gravatar...
Hey this thing worked...
thanks for the fix...
any reason why it failed if we didnt put the HtmlTextWriterTag.Span??
Left by Vandan on Aug 20, 2006 10:44 PM

# re: MetaBuilders.ComboBox compile with Visual Studio 2005
Requesting 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
Left by Michael Freidgeim on Aug 21, 2006 8:21 AM

Your comment:
 (will show your gravatar)


Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net