Implementing IPostBackDataHandler in a custom web control with VB.NET

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default 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.
    Andrew Dawson Guest

  2. Similar Questions and Discussions

    1. ListControl: SelectedIndexChanged event raised without implementing IPostBackDataHandler?
      Hi, I'm designing a control that inherits ListControl I was surprised to see that SelectedIndexChanged is part of ListControl. So why doesn't it...
    2. IPostBackDataHandler and validating a control -- the best place to do this.
      Hi, I have an asp.net page with two composite controls on it as well as a single button in the asp.net page AND a single dropdown box on the page...
    3. Implementing columns collection in Data grid custom control
      Dear all, I am building a custom control data grid with some necessary functionalities. let it be <myCustomDataGrid> in .Net data grid we have...
    4. Implementing postback functionality in custom control
      Here is my situation. I first made a custom composite control (consisting of a textbox and button) that does a whois lookup based on the domain name...
    5. Implementing Control Designer Class for Composite Server Control
      I created a custom composite server control with 2 literals and 1 text box. The control displays fine in internet explorer, but doesnt display...
  3. #2

    Default 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:
    [url]http://weblogs.asp.net/fbouma/archive/2003/11/12/37199.aspx[/url]

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

    "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.

    Teemu Keiski Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139