LinkButton Inherited from WebControl problem?

Discussion in 'ASP .Net Web Controls' started by Dave, Jun 22, 2004.

  1. Dave

    Dave Guest

    Hi,

    I'm inheriting a LinkButton from a WebControl....

    public class LinkButtonFromWebControl : System.Web.UI.WebControls.WebControl

    However, in the aspx, if I add the "CssClass=", "CausesValidation=", etc attributes to this control...

    <Custom:LinkButtonFromWebControl id="LinkButton3" runat="server" CssClass="linkButtonClass" CausesValidation=False>LinkButton inherited From WebControl</Custom:LinkButtonFromWebControl>

    why aren't they displayed as part of the HTML output automatically when the control is rendered?

    It's as if I have to manually add them the html output by using "class=" + this.CssClass etc. I would think if this control is inherited from WebControl it would do this for you??

    Do I have to implement some type of handler? Thanks, Dave
     
    Dave, Jun 22, 2004
    #1
    1. Advertising

  2. Dave

    Teemu Keiski Guest

    Hi,

    have you overridden something in addition to just deriving from WebControl?

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


    "Dave" <> wrote in message
    news:...
    > Hi,
    >
    > I'm inheriting a LinkButton from a WebControl....
    >
    > public class LinkButtonFromWebControl :

    System.Web.UI.WebControls.WebControl
    >
    > However, in the aspx, if I add the "CssClass=", "CausesValidation=", etc

    attributes to this control...
    >
    > <Custom:LinkButtonFromWebControl id="LinkButton3" runat="server"

    CssClass="linkButtonClass" CausesValidation=False>LinkButton inherited From
    WebControl</Custom:LinkButtonFromWebControl>
    >
    > why aren't they displayed as part of the HTML output automatically when

    the control is rendered?
    >
    > It's as if I have to manually add them the html output by using "class=" +

    this.CssClass etc. I would think if this control is inherited from
    WebControl it would do this for you??
    >
    > Do I have to implement some type of handler? Thanks, Dave
    >
     
    Teemu Keiski, Jun 23, 2004
    #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. Sathyaish
    Replies:
    3
    Views:
    3,169
    Sathyaish
    Sep 8, 2005
  2. Nathan Sokalski
    Replies:
    1
    Views:
    1,390
    Nathan Sokalski
    Jul 31, 2009
  3. Dave

    CssClass property not recognized by Inherited WebControl?

    Dave, Jun 21, 2004, in forum: ASP .Net Building Controls
    Replies:
    3
    Views:
    161
    Victor Garcia Aprea [MVP]
    Jun 22, 2004
  4. Sathyaish

    Linkbutton does not look like a linkbutton

    Sathyaish, Sep 8, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    217
    Sathyaish
    Sep 8, 2005
  5. 7stud --
    Replies:
    11
    Views:
    467
    7stud --
    Nov 9, 2007
Loading...

Share This Page