Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Adding CSS to LinkButton

Reply
Thread Tools

Adding CSS to LinkButton

 
 
Maziar Aflatoun
Guest
Posts: n/a
 
      02-15-2005
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.


 
Reply With Quote
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      02-15-2005
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" <> wrote in message
news:n-WdnaN446xa9IzfRVn-...
> 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.
>
>


 
Reply With Quote
 
 
 
 
Maziar Aflatoun
Guest
Posts: n/a
 
      02-15-2005
Worked. Thanks
Maz.


"Ken Cox [Microsoft MVP]" <> wrote in message
news:...
> 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" <> wrote in message
> news:n-WdnaN446xa9IzfRVn-...
>> 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.
>>
>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linkbutton does not look like a linkbutton Sathyaish ASP .Net 3 09-08-2005 09:41 AM
Linkbutton does not look like a linkbutton Sathyaish ASP .Net Datagrid Control 1 09-08-2005 08:44 AM
Setting OnCommand when adding LinkButton dynamically Sheryl Landon ASP .Net 1 04-06-2005 12:41 AM
Re: Adding LinkButton + click Event dynamically Vaibhav ASP .Net 0 08-28-2003 07:50 PM
Re: Adding LinkButton + click Event dynamically Felipe Garcia ASP .Net 1 08-28-2003 06:32 PM



Advertisments
 



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