a custom control in VB.NET that inherits from TextBox and from IPostBackDataHandler....

Discussion in 'ASP .Net' started by z f, Mar 1, 2006.

  1. z f

    z f Guest

    Hi.

    How can I make a custom control in VB.NET that is inheriting from TextBox
    and also implements/inherits the IPostBackDataHandler?
    the problem is that in VB.NET I can't inherit from more that one class, but
    when I try to inherit from TextBox and Implement IPostBackDataHandler i get
    an error of
    "Interface 'System.Web.UI.IPostBackDataHandler' is already implemented by
    base class 'System.Web.UI.WebControls.TextBox'."
    but if I want to override the LoadPostData of the IPostBackDataHander
    implemented by the TextBox class I just Can't!
    it is probably private.
    So I can't achive what can be achived easily using C# - inheriting from
    TextBox and from IPostBackDataHandler?
    VB Gurus please help!

    TIA.
     
    z f, Mar 1, 2006
    #1
    1. Advertising

  2. RE: a custom control in VB.NET that inherits from TextBox and from IPo

    Zf,
    First off ASP.Net validates that the postbackdata does not contain malious
    content and other validations before it reaches your code. Try designing
    using the textbox changed event like the rest of us.

    To use interface implemented by base class use mybase. Example mybase.focus
    To change a method, or function that is implemented by the base class use
    overrides. Type in OVERRIDES (outside of any method,function, sub) and select
    from dropdown list press enter.

    Good Luck
    DWS




    "z f" wrote:

    > Hi.
    >
    > How can I make a custom control in VB.NET that is inheriting from TextBox
    > and also implements/inherits the IPostBackDataHandler?
    > the problem is that in VB.NET I can't inherit from more that one class, but
    > when I try to inherit from TextBox and Implement IPostBackDataHandler i get
    > an error of
    > "Interface 'System.Web.UI.IPostBackDataHandler' is already implemented by
    > base class 'System.Web.UI.WebControls.TextBox'."
    > but if I want to override the LoadPostData of the IPostBackDataHander
    > implemented by the TextBox class I just Can't!
    > it is probably private.
    > So I can't achive what can be achived easily using C# - inheriting from
    > TextBox and from IPostBackDataHandler?
    > VB Gurus please help!
    >
    > TIA.
    >
    >
    >
     
    =?Utf-8?B?RFdT?=, Mar 1, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. One Handed Man \( OHM - Terry Burns \)

    Custom Control & System.Web.UI.IPostBackDataHandler.LoadPostData

    One Handed Man \( OHM - Terry Burns \), Jun 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,944
    One Handed Man \( OHM - Terry Burns \)
    Jun 17, 2004
  2. Alex Nitulescu
    Replies:
    0
    Views:
    355
    Alex Nitulescu
    Feb 22, 2005
  3. CsaaGuy
    Replies:
    2
    Views:
    983
    Mythran
    Jul 13, 2005
  4. Andrew Dawson

    Implementing IPostBackDataHandler in a custom web control with VB.NET

    Andrew Dawson, Aug 9, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    419
    Teemu Keiski
    Aug 12, 2004
  5. ton
    Replies:
    1
    Views:
    1,029
    Teemu Keiski
    Jun 24, 2007
Loading...

Share This Page