Why can't I override RenderBeginTag?

L

Lisa

I'm trying to make a custom control. I started off basing it on a
ListBox, but because of the bug in that control that prevents it from
rendering name/value pairs, I decided to use an HTMLSelect instead.

But when I changed it, I started getting an error:

Public Overrides Sub RenderBeginTag(ByVal writer As
System.Web.UI.HtmlTextWriter)

C:\Inetpub\wwwroot\BuildDir\UTILITIES\LLList\LLList.vb(39): 'Public
Overrides Sub RenderBeginTag(writer As System.Web.UI.HtmlTextWriter)'
cannot override 'Protected Overridable Sub RenderBeginTag(writer As
System.Web.UI.HtmlTextWriter)' because they have different access
levels.

Can anyone explain what's up here? HTMLSelect does have a
RenderBeginTag method, so why can't I override it? What are the
access levels here?

Thanks,
Lisa
 
J

John Saunders

Lisa said:
C:\Inetpub\wwwroot\BuildDir\UTILITIES\LLList\LLList.vb(39): 'Public
Overrides Sub RenderBeginTag(writer As System.Web.UI.HtmlTextWriter)'
cannot override 'Protected Overridable Sub RenderBeginTag(writer As
System.Web.UI.HtmlTextWriter)' because they have different access
levels.

The error message tells you the exact problem. You are trying to override a
"Protected" member with a "Public" one.

John Saunders
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top