Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Building Controls (http://www.velocityreviews.com/forums/f59-asp-net-building-controls.html)
-   -   Implementing IPostBackDataHandler in a custom web control with VB.NET (http://www.velocityreviews.com/forums/t756973-implementing-ipostbackdatahandler-in-a-custom-web-control-with-vb-net.html)

Andrew Dawson 08-09-2004 08:41 PM

Implementing IPostBackDataHandler in a custom web control with VB.NET
 
I have created a custom class with Visual Basic that inherits from the
drop down list web control. In order to update the value properly, I
have tried to implement IPostBackDataHandler, but receive the
following error message:

Interface 'System.Web.UI.IPostBackDataHandler' is already implemented
by base class 'System.Web.UI.WebControls.DropDownList'.

My code is as follows:

Imports System.Web.UI

Public Class CodeDescDropDown
Inherits System.Web.UI.WebControls.DropDownList
Implements INamingContainer
Implements IPostBackDataHandler

Protected Overrides Sub Render(ByVal output as
System.Web.UI.HtmlTextWriter)
Mybase.Render(output)
End Sub

'Class implementation

End Class

For some reason, this error is not created if I use C# to write the
class, but I really want to use VB. Please let me know if you need
more information. Thanks for the help.

Teemu Keiski 08-12-2004 06:34 PM

Re: Implementing IPostBackDataHandler in a custom web control with VB.NET
 
Hi,

this is a lack of feature in VB.NET. It doesn't allow you to reimplement an
interface on derived class, but C# does.

See here:
http://weblogs.asp.net/fbouma/archiv.../12/37199.aspx

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke

"Andrew Dawson" <adawson@ufcw.org> wrote in message
news:4fc58d42.0408091241.6ed1f838@posting.google.c om...
> I have created a custom class with Visual Basic that inherits from the
> drop down list web control. In order to update the value properly, I
> have tried to implement IPostBackDataHandler, but receive the
> following error message:
>
> Interface 'System.Web.UI.IPostBackDataHandler' is already implemented
> by base class 'System.Web.UI.WebControls.DropDownList'.
>
> My code is as follows:
>
> Imports System.Web.UI
>
> Public Class CodeDescDropDown
> Inherits System.Web.UI.WebControls.DropDownList
> Implements INamingContainer
> Implements IPostBackDataHandler
>
> Protected Overrides Sub Render(ByVal output as
> System.Web.UI.HtmlTextWriter)
> Mybase.Render(output)
> End Sub
>
> 'Class implementation
>
> End Class
>
> For some reason, this error is not created if I use C# to write the
> class, but I really want to use VB. Please let me know if you need
> more information. Thanks for the help.





All times are GMT. The time now is 07:50 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.