Cascading Style Sheets Tutorial

Asp.net datagrid on the application of CSS style BUTTON

  In asp.net, if we are to a certain button, and TEXTBOX application form, we can use CSSCLASS attributes, such as 

<asp:Label runat="server" id="lblMessage" CssClass="abc" Text="Hi!" />
&nbsp; The abc&#39;s your definition of the CSS style, and if the datagrid button in the application css style, and if so to write it&nbsp;
<asp:DataGrid id="dgArticles" runat="server" AutoGenerateColumns="False" ...><Columns><asp:ButtonColumn Text="提交" CssClass="abc" /> &#8230; </Columns></asp:DataGrid>
  This write is wrong and can not achieve operating results because the BUTTONCOLUMN datagrid, not CSSCLASS attributes, the right approach, it should be in the ItemCreated event, write the following code: 
  If e.Item.ItemType ListItemType.Item OR = _ 
  E.Item.ItemType = ListItemType.AlternatingItem then 

  Dim myButton as Button = CType (e.Item.Cells (0). Controls (0), Button) 
  MyButton.CssClass = "abc" 


Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • DZone

Tags: Border Style, css button, css style, css style sheet, div style, style

Releated Posts

  • Good CSS style [beautiful button]
  • Css style button imitate windows
  • Several classic button CSS style
  • A case XP style button production
  • Fireworks produced by MAC style button

This entry was posted on Thursday, January 31st, 2008 at 12:00 am and is filed under Css+Div Web Design. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

« How to use their own CSS Blog replace the default style (Author: Xuefeng)
Site Reconstruction CSS style sheet and the optimization techniques »

Leave a Reply

  • Categories

    • CSS Properties (491)
    • CSS Tutorial (1154)
    • CSS Tutorial By Examples (1201)
    • Css+Div Web Design (3274)
    • Xhtml and Web Design (1797)
  • Archives

    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
  • Pages

    • About us

Cascading Style Sheets Tutorial