Linkbutton does not look like a linkbutton

Discussion in 'ASP .Net' started by Sathyaish, Sep 8, 2005.

  1. Sathyaish

    Sathyaish Guest

    OK, I almost got my problem solved. Zen is almost there! Just that a
    LinkButton control inside a column in my datagrid doesn't show like a
    link button. It does not have an underlining. My client side JavaScript
    is enabled. How do I make the button underlined and appear and act like
    a linkbutton? Currently, it just displays the text like a normal
    label/table cell that has a label.
     
    Sathyaish, Sep 8, 2005
    #1
    1. Advertising

  2. Sathyaish

    Hans Kesting Guest

    Sathyaish wrote:
    > OK, I almost got my problem solved. Zen is almost there! Just that a
    > LinkButton control inside a column in my datagrid doesn't show like a
    > link button. It does not have an underlining. My client side
    > JavaScript is enabled. How do I make the button underlined and appear
    > and act like a linkbutton? Currently, it just displays the text like
    > a normal label/table cell that has a label.


    Does it *work* like a linkbutton?
    That linkbutton is just a regular hyperlink for the browser, so standard CSS applies.
    Does your CSS remove that underlining from all hyperlinks?

    Hans Kesting
     
    Hans Kesting, Sep 8, 2005
    #2
    1. Advertising

  3. Sathyaish

    Sathyaish Guest

    It looks like the LinkButton cannot be databound. If it is, it just
    disappears. As a test, I tried this:

    <asp:TemplateColumn HeaderText="Full Name">
    <ItemTemplate>
    <asp:LinkButton OnClick="dg_ItemCommand">
    <%# DataBinder.Eval(Container.DataItem, "Full Name")%>
    </asp:LinkButton>
    </ItemTemplate>
    </asp:TemplateColumn>


    The column displays the correct full name value but no underlining. I
    am guessing that the grid replaced the linkbutton with a literal
    control. I did this and found out.

    lblMessage.Text = dg.Items(1).Cells(0).Controls(0).GetType.ToString

    in a button_click.


    Then, I tried this:

    <asp:LinkButton id="lnk" style="Z-INDEX: 104; LEFT: 432px; POSITION:
    absolute; TOP: 80px" runat="server">The date and time is: <%#
    System.DateTime.Now.ToLongDateString %></asp:LinkButton>

    And it only showed the link button with the text

    The date and time is:


    How do I have a control in a grid that:

    (1) Is DataBound
    (2) Appears and acts like a linkbutton
    (3) Does not behave like the ItemTemplate's EditItem where you have
    those edit textboxes inside the grid itself.
     
    Sathyaish, Sep 8, 2005
    #3
  4. Sathyaish

    Sathyaish Guest

    No, the default CSS, Styles.css in my solution does the formatting and
    it doesn't override any default styles. So, if I look at a new
    LinkButton that I drag from the toolbox to the web form, it looks
    alright and behaves alright.

    Just that when I try to bind it, it disappears. Look at my post above
    in this same thread. I am suspecting that the link button does not
    support data binding.

    Can you give me an alternative for a control that data binds and also
    acts like a link and has a post method rather than redirect?
     
    Sathyaish, Sep 8, 2005
    #4
    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. Alex
    Replies:
    0
    Views:
    416
  2. =?Utf-8?B?Q3JhaWc4MzE=?=
    Replies:
    4
    Views:
    1,003
    Craig Jeffords
    Sep 14, 2005
  3. Daan
    Replies:
    20
    Views:
    759
    Chris F.A. Johnson
    Sep 28, 2007
  4. Sathyaish

    Linkbutton does not look like a linkbutton

    Sathyaish, Sep 8, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    207
    Sathyaish
    Sep 8, 2005
  5. active
    Replies:
    4
    Views:
    300
    active
    Apr 3, 2007
Loading...

Share This Page