Need help with styles in .net 3.5 .

Hi i currently have a page with the following:

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<title>Invoice Approval</title>

<LINK href="../Common/Style/MyStyle.css" type="text/css" rel="stylesheet">

<style type="text/css">

.style1

{

width: 878px;

height: 512px;

position: absolute;

left: 10px;

top: 56px;

}

#BtnApprove

{

width: 93px;

height: 23px;

font-family: Arial,Helvetica, sans-serif;

font-size: 12px;

font-weight: bold;

color:#ffffff;

BACKGROUND-COLOR:#678FC2;text-align: center

}

#BtnWithheld

{

width: 93px;

height: 23px;

font-family: Arial,Helvetica, sans-serif;

font-size: 12px;

font-weight: bold;

color:#ffffff;

BACKGROUND-COLOR:#678FC2;text-align: center

}

#BtnDeSelectPage

{

width: 93px;

height: 23px;

font-family: Arial,Helvetica, sans-serif;

font-size: 12px;

font-weight: bold;

color:#ffffff;

BACKGROUND-COLOR:#678FC2;text-align: center

}

#BtnSelectAll

{

width: 93px;

height: 23px;

font-family: Arial,Helvetica, sans-serif;

font-size: 12px;

font-weight: bold;

color:#ffffff;

BACKGROUND-COLOR:#678FC2;text-align: center

}

#BtnDeselectAll

{

width: 93px;

height: 23px;

font-family: Arial,Helvetica, sans-serif;

font-size: 12px;

font-weight: bold;

color:#ffffff;

BACKGROUND-COLOR:#678FC2;text-align: center

}

#BtnSelectPage

{

width: 93px;

height: 23px;

font-family: Arial,Helvetica, sans-serif;

font-size: 12px;

font-weight: bold;

color:#ffffff;

BACKGROUND-COLOR:#678FC2;text-align: center

}

#BtnReturn

{

width: 93px;

height: 23px;

font-family: Arial,Helvetica, sans-serif;

font-size: 12px;

font-weight: bold;

color:#ffffff;

BACKGROUND-COLOR:#678FC2;text-align: center

}

#BtnWithHeld

{

width: 93px;

height: 23px;

font-family: Arial,Helvetica, sans-serif;

font-size: 12px;

font-weight: bold;

color:#ffffff;

BACKGROUND-COLOR:#678FC2;text-align: center

}

</style>

 

<%
--td.menu_buttons --%>

 

 

 

</head>

<body>

<form id="Approval" runat="server">

<asp:ScriptManager ID="ScriptManager1" runat="server">

</asp:ScriptManager>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<ContentTemplate>

 

<input type="hidden" id="CMD" runat="server"> <input type="hidden" id="Reason" runat="server" NAME="Reason">

<input type="hidden" id="Inv" runat="server" NAME="Inv"> <input type="hidden" id="PageNo" runat="server" NAME="PageNo">

<input type="hidden" id="DateFormat" runat="server" NAME="DateFormat"> <input type="hidden" id="StartRow" runat="server" NAME="StartRow">

<input type="hidden" id="CurrencySymbol" runat="server" NAME="CurrencySymbol">

<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" align="right">

<TR VALIGN="baseline" width="90px" height="23px">

<TD><Button ID="BtnApprove" onclick="INVAction('A')" />Approve</TD>

<TD><Button ID="BtnReturn" onclick="INVAction('R')"/>Return</TD>

<TD><Button ID="BtnWithHeld" onclick="INVAction('W')" />Withheld</TD>

<TD><Button ID="BtnSelectPage" onclick="INVAction('SP')" />Select Page</TD>

<TD><Button ID="BtnDeSelectPage" onclick="INVAction('DSP')" />Deselect Page</TD>

<TD><Button ID="BtnSelectAll" onclick="INVAction('SA')" />Select All</TD>

<TD><Button ID="BtnDeselectAll" onclick="INVAction('DSA')" />Deselect All</TD>

</tr>

</TABLE>

<div>

.. how can i make each button access the styles in the MyStyle.css file and not use the ones in .style .?

 

thanks

robby

0
robby32
5/1/2008 6:53:09 AM
asp.net.client-side 24353 articles. 1 followers. Follow

4 Replies
347 Views

Similar Articles

[PageSpeed] 9

 Hi,

 First of all, if those classes in the style element are repeated in the css file, remove them! secondly, make sure that the href for the css file is correct! i see nothing else that could be a problem...

Clayton
 


Clayton
If this post answered your question please 'Mark as Answer'
0
claytonc
5/1/2008 7:09:57 AM

Check out this code...

 

Default.aspx 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Untitled page</title>
    <link href="Styles/MyStyle.css" rel="Stylesheet" type="text/css" />
</head>
<body>
    <form id="frmDefault" runat="server">
        <asp:ScriptManager ID="aspScriptManager" runat="server" />
        <asp:UpdatePanel ID="aspUpdatePanel" runat="server">
             <ContentTemplate>
                <table>
                    <tr>
                        <td><button id="btnAdd">Test</button></td>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>

MyStyles.css

#btnAdd
{
    background-color: #000;
    color: #FFF;   
}

 

It worked fine... just repeat the process for each other button with a different ID

Clayton
 


Clayton
If this post answered your question please 'Mark as Answer'
0
claytonc
5/1/2008 8:46:28 AM

Hi ,

thanks

this is great. 

 I have three different skins that i apply to the app ... so can i have three different css files with the same name and depending on the skin then it calls the right style ? Each css file wil be in its own directory

thanks

robby

 

0
robby32
5/1/2008 11:17:23 AM

 Yeap. I think it's a good approach...

 


Clayton
If this post answered your question please 'Mark as Answer'
0
claytonc
5/1/2008 12:37:18 PM
Reply: