Professional Web Applications Themes

Adding CSS to LinkButton - ASP.NET Data Grid Control

Hi, Does anyone know how I can add a css to the following link button. I want to add it so that Update, Cancel and Edit have the css in the form of <a href="" class="">Update</a> <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" EditText="Edit"></asp:EditCommandColumn> Thank you Maz....

  1. #1

    Default Adding CSS to LinkButton

    Hi,

    Does anyone know how I can add a css to the following link button. I want to
    add it so that Update, Cancel and Edit have the css in the form of <a
    href="" class="">Update</a>
    <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update"
    CancelText="Cancel" EditText="Edit"></asp:EditCommandColumn>

    Thank you
    Maz.


    Maziar Aflatoun Guest

  2. #2

    Default Re: Adding CSS to LinkButton

    Hey Maz,

    You need to create a style class and then assign it to the CssClass
    property. Use a template column for this.

    Does this help?

    Ken
    Microsoft MVP [ASP.NET]
    Toronto

    <style>
    .myclass { font-size: 1.17em;
    text-decoration: none;
    color: #333399;
    }
    </style>

    <asp:templatecolumn>
    <itemtemplate>
    <asp:linkbutton CssClass="myclass"
    runat="server" Text="Edit" CommandName="Edit"
    CausesValidation="false"></asp:linkbutton>
    </itemtemplate>
    <edititemtemplate>
    <asp:linkbutton CssClass="myclass"
    runat="server" Text="Update" CommandName="Update"></asp:linkbutton>&nbsp;
    <asp:linkbutton CssClass="myclass"
    runat="server" Text="Cancel" CommandName="Cancel"
    CausesValidation="false"></asp:linkbutton>
    </edititemtemplate>
    </asp:templatecolumn>


    "Maziar Aflatoun" <maz00rogers.com> wrote in message
    news:n-WdnaN446xa9IzfRVn-ogrogers.com...
    > Hi,
    >
    > Does anyone know how I can add a css to the following link button. I want
    > to add it so that Update, Cancel and Edit have the css in the form of <a
    > href="" class="">Update</a>
    > <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update"
    > CancelText="Cancel" EditText="Edit"></asp:EditCommandColumn>
    >
    > Thank you
    > Maz.
    >
    >
    Ken Cox [Microsoft MVP] Guest

  3. #3

    Default Re: Adding CSS to LinkButton

    Worked. Thanks
    Maz.


    "Ken Cox [Microsoft MVP]" <BANSPAMken_coxsympatico.ca> wrote in message
    news:eBA4kX2EFHA.1924TK2MSFTNGP14.phx.gbl...
    > Hey Maz,
    >
    > You need to create a style class and then assign it to the CssClass
    > property. Use a template column for this.
    >
    > Does this help?
    >
    > Ken
    > Microsoft MVP [ASP.NET]
    > Toronto
    >
    > <style>
    > .myclass { font-size: 1.17em;
    > text-decoration: none;
    > color: #333399;
    > }
    > </style>
    >
    > <asp:templatecolumn>
    > <itemtemplate>
    > <asp:linkbutton CssClass="myclass"
    > runat="server" Text="Edit" CommandName="Edit"
    > CausesValidation="false"></asp:linkbutton>
    > </itemtemplate>
    > <edititemtemplate>
    > <asp:linkbutton CssClass="myclass"
    > runat="server" Text="Update" CommandName="Update"></asp:linkbutton>&nbsp;
    > <asp:linkbutton CssClass="myclass"
    > runat="server" Text="Cancel" CommandName="Cancel"
    > CausesValidation="false"></asp:linkbutton>
    > </edititemtemplate>
    > </asp:templatecolumn>
    >
    >
    > "Maziar Aflatoun" <maz00rogers.com> wrote in message
    > news:n-WdnaN446xa9IzfRVn-ogrogers.com...
    >> Hi,
    >>
    >> Does anyone know how I can add a css to the following link button. I want
    >> to add it so that Update, Cancel and Edit have the css in the form of <a
    >> href="" class="">Update</a>
    >> <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update"
    >> CancelText="Cancel" EditText="Edit"></asp:EditCommandColumn>
    >>
    >> Thank you
    >> Maz.
    >>
    >>
    >

    Maziar Aflatoun Guest

Similar Threads

  1. LInkButton clikc animation
    By Tikis Mikis in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: May 21st, 09:24 PM
  2. LinkButton question
    By treilly via DotNetMonster.com in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: November 14th, 08:52 PM
  3. Linkbutton does not look like a linkbutton
    By Sathyaish in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: September 8th, 08:44 AM
  4. LinkButton
    By Hugo Flores in forum ASP.NET General
    Replies: 4
    Last Post: July 4th, 08:01 PM
  5. Format of LinkButton..?
    By Onur Bozkurt in forum ASP.NET General
    Replies: 1
    Last Post: July 1st, 07:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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