Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
1.20/5 (2 votes)
See more:
Hellow!
This is my first question. I create css class and try to apply on AjaxtoolKit Control with "link" tag.It's not work but When I place this CSS class on same page where I place my Control between "style" tag. It's work perfectly.Please any one answer me. I want to apply css class not "style" tag.What I do.
Posted
Updated 18-Jun-14 18:28pm
v3
Comments
Sergey Alexandrovich Kryukov 19-Jun-14 0:38am    
It is not applying because you did not apply it. :-) You could screw up it in so many ways that taking a guess makes no sense at all; you can only get an advice if you provide some code samples and steps to reproduce the problem.
—SA
Umer Makhmal 19-Jun-14 0:57am    
This Code put in my css class. It's not work.


body {

}
#MenuControl {
margin-top:35px;
}
.DyMenuHoverStyle {
margin-top:1px;
float: left;
width: 390%;
height: 20px;
font: bold 12px verdana;
background: -moz-linear-gradient(silver, black);
}
#_TreeMenu {
width:20%;
}
.accordion {
width:100%;
}
.accordionHeader {
border: 1px solid #2F4F4F;
color: white;
background-color: #2E4d7B;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}

.accordionHeaderSelected {
border: 1px solid #2F4F4F;
color: white;
background-color: #5078B3;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}

.accordionContent {
/*=====background-color: #D3DEEF;*/
background-color:aliceblue;
border: 1px none #2F4F4F;
border-top: none;
padding: 5px;
padding-top: 0px;
}

#mBody {
float:left;
margin-top:1px;
border:1px solid black;
height:100%;
width:100%;
}
#_Iframe {
margin-top:0px;
border:1px solid black;
width: 100%;
height:100%;

}
---------------------------------------
This code put in "style" tag.it's work perfectly.



<style type="text/css">
/*.side-style {
vertical-align:top;
height: 700px;
width: 15%;
}
.content-style {
border:1px solid black;
height: 700px;
width: 80%;
}*/

#MenuControl {
margin-top:35px;
}
.DyMenuHoverStyle {
margin-top:1px;
float: left;
width: 390%;
height: 20px;
font: bold 12px verdana;
background: -moz-linear-gradient(silver, black);
}
#_TreeMenu {
width:20%;
}
.accordion {
width:100%;
}
.accordionHeader {
border: 1px solid #2F4F4F;
color: white;
background-color: #2E4d7B;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}

.accordionHeaderSelected {
border: 1px solid #2F4F4F;
color: white;
background-color: #5078B3;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}

.accordionContent {
/*=====background-color: #D3DEEF;*/
background-color:aliceblue;
border: 1px none #2F4F4F;
border-top: none;
padding: 5px;
padding-top: 0px;
}

#mBody {
float:left;
margin-top:1px;
border:1px solid black;
height:100%;
width:100%;
}
#_Iframe {
margin-top:0px;
border:1px solid black;
width: 100%;
height:100%;

}

</style>

--------------------------------------
this is my control in which I want to apply this css.

<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">

<ajaxToolkit:Accordion ID="Accordion1" runat="server"
CssClass="accordionContent"
HeaderCssClass="accordionHeader"
HeaderSelectedCssClass="accordionHeaderSelected"
ContentCssClass="accordionContent" FramesPerSecond="30" height="700px">
Umer Makhmal 19-Jun-14 1:04am    
this is my control in which I want to apply this css.

<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">

<ajaxToolkit:Accordion ID="Accordion1" runat="server"
CssClass="accordionContent"
HeaderCssClass="accordionHeader"
HeaderSelectedCssClass="accordionHeaderSelected"
ContentCssClass="accordionContent" FramesPerSecond="30" height="700px">
[no name] 19-Jun-14 1:14am    
Please check your css file is included in your aspx page or not
ashok rathod 19-Jun-14 2:17am    
Agree with @NitinDhapte ... There might be the issue that your css file might not be included in your aspx page and second problem might be that some other style might be overlapping your style

I was Include my css file . With
"" but it's not working.
 
Share this answer
 
Comments
Umer Makhmal 20-Jun-14 0:14am    
This is my aspx page
===============================================

<%@ Master Language="C#" MasterPageFile="~/Home.Master" AutoEventWireup="true" CodeBehind="Module.master.cs" Inherits="InventorySystem_ASP.NET_.Module" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link rel="stylesheet" href="CSS/TabControlLayout.css" />

/* Here I'm attach css file*/
<link href="CSS/DynamicControl.css" rel="stylesheet" />




<style type="text/css">
.side-style {
vertical-align:top;
height: 700px;
width: 15%;
}
.content-style {
border:1px solid black;
height: 700px;
width: 80%;
}

/*#MenuControl {
margin-top:35px;
}
.DyMenuHoverStyle {
margin-top:1px;
float: left;
width: 390%;
height: 20px;
font: bold 12px verdana;
background: -moz-linear-gradient(silver, black);
}
#_TreeMenu {
width:20%;
}
.accordion {
width:100%;
}
.accordionHeader {
border: 1px solid #2F4F4F;
color: white;
background-color: #2E4d7B;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}

.accordionHeaderSelected {
border: 1px solid #2F4F4F;
color: white;
background-color: #5078B3;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}

.accordionContent {
/*=====background-color: #D3DEEF;*/
/*background-color:aliceblue;
border: 1px none #2F4F4F;
border-top: none;
padding: 5px;
padding-top: 0px;
}

#mBody {
float:left;
margin-top:1px;
border:1px solid black;
height:100%;
width:100%;
}
#_Iframe {
margin-top:0px;
border:1px solid black;
width: 100%;
height:100%;

}*/

</style>



<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<div id="body">
<ul id="tabmenu">
<li>Inventory</li>
<li>Purchase</li>
<li>Sale</li>
</ul>
</div>


<%-- <iframe id="_MainFrame" src="" name="MainFrame" runat="server" width="100%" frameborder="0">--%>
<asp:ContentPlaceHolder ID="ModContent" runat="server">
<div id="tabpage">
<table style="width: 100%; height:700px;">
<tr>
<td class="side-style">
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">

<ajaxToolkit:Accordion ID="Accordion1" runat="server"
CssClass="accordionContent"
HeaderCssClass="accordionHeader"
HeaderSelectedCssClass="accordionHeaderSelected"
ContentCssClass="accordionContent" FramesPerSecond="30" height="700px">

</td>
<td class="content-style">
<iframe ID="_Iframe" src="" name="ifrme_a" runat="server" width="100%" height="100%" frameBorder="0"></iframe>
</td>
Umer Makhmal 20-Jun-14 0:14am    
=======================
This is my css Class
===============================


<pre lang="css">body {

}
#MenuControl {
margin-top:35px;
}
.DyMenuHoverStyle {
margin-top:1px;
float: left;
width: 390%;
height: 20px;
font: bold 12px verdana;
background: -moz-linear-gradient(silver, black);
}
#_TreeMenu {
width:20%;
}
.accordion {
width:100%;
}
.accordionHeader {
border: 1px solid #2F4F4F;
color: white;
background-color: #2E4d7B;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}

.accordionHeaderSelected {
border: 1px solid #2F4F4F;
color: white;
background-color: #5078B3;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}

.accordionContent {
/*=====background-color: #D3DEEF;*/
background-color:aliceblue;
border: 1px none #2F4F4F;
border-top: none;
padding: 5px;
padding-top: 0px;
}

#mBody {
float:left;
margin-top:1px;
border:1px solid black;
height:100%;
width:100%;
}
#_Iframe {
margin-top:0px;
border:1px solid black;
width: 100%;
height:100%;

}</pre>
Use this code
CSS
body {

}
#MenuControl {
margin-top:35px;
}
.DyMenuHoverStyle {
margin-top:1px;
float: left;
width: 390%;
height: 20px;
font: bold 12px verdana;
background: -moz-linear-gradient(silver, black);
}
#_TreeMenu {
width:20%;
}
.accordion {
width:100%;
}
.accordionHeader {
border: 1px solid #2F4F4F;
color: white;
background-color: #2E4d7B;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}

.accordionHeaderSelected {
border: 1px solid #2F4F4F;
color: white;
background-color: #5078B3;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}

.accordionContent {
/*=====background-color: #D3DEEF;*/
background-color:aliceblue;
border: 1px none #2F4F4F;
border-top: none;
padding: 5px;
padding-top: 0px;
}

#mBody {
float:left;
margin-top:1px;
border:1px solid black;
height:100%;
width:100%;
}
#_Iframe {
margin-top:0px;
border:1px solid black;
width: 100%;
height:100%;

}
---------------------------------------
This code put in "style" tag.it's work perfectly.



<style type="text/css">
/*.side-style {
vertical-align:top;
height: 700px;
width: 15%;
}
.content-style {
border:1px solid black;
height: 700px;
width: 80%;
}*/

#MenuControl {
margin-top:35px;
}
.DyMenuHoverStyle {
margin-top:1px;
float: left;
width: 390%;
height: 20px;
font: bold 12px verdana;
background: -moz-linear-gradient(silver, black);
}
#_TreeMenu {
width:20%;
}
.accordion {
width:100%;
}
.accordionHeader {
border: 1px solid #2F4F4F;
color: white;
background-color: #2E4d7B;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}

.accordionHeaderSelected {
border: 1px solid #2F4F4F;
color: white;
background-color: #5078B3;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}

.accordionContent {
/*=====background-color: #D3DEEF;*/
background-color:aliceblue;
border: 1px none #2F4F4F;
border-top: none;
padding: 5px;
padding-top: 0px;
}

#mBody {
float:left;
margin-top:1px;
border:1px solid black;
height:100%;
width:100%;
}
#_Iframe {
margin-top:0px;
border:1px solid black;
width: 100%;
height:100%;

}
 
Share this answer
 
Use this code
body {

}
#MenuControl {
margin-top:35px;
}
.DyMenuHoverStyle {
margin-top:1px;
float: left;
width: 390%;
height: 20px;
font: bold 12px verdana;
background: -moz-linear-gradient(silver, black);
}
#_TreeMenu {
width:20%;
}
.accordion {
width:100%;
}
.accordionHeader {
border: 1px solid #2F4F4F;
color: white;
background-color: #2E4d7B;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}

.accordionHeaderSelected {
border: 1px solid #2F4F4F;
color: white;
background-color: #5078B3;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}

.accordionContent {
/*=====background-color: #D3DEEF;*/
background-color:aliceblue;
border: 1px none #2F4F4F;
border-top: none;
padding: 5px;
padding-top: 0px;
}

#mBody {
float:left;
margin-top:1px;
border:1px solid black;
height:100%;
width:100%;
}
#_Iframe {
margin-top:0px;
border:1px solid black;
width: 100%;
height:100%;

}
---------------------------------------
This code put in "style" tag.it's work perfectly.



<style type="text/css">
/*.side-style {
vertical-align:top;
height: 700px;
width: 15%;
}
.content-style {
border:1px solid black;
height: 700px;
width: 80%;
}*/

#MenuControl {
margin-top:35px;
}
.DyMenuHoverStyle {
margin-top:1px;
float: left;
width: 390%;
height: 20px;
font: bold 12px verdana;
background: -moz-linear-gradient(silver, black);
}
#_TreeMenu {
width:20%;
}
.accordion {
width:100%;
}
.accordionHeader {
border: 1px solid #2F4F4F;
color: white;
background-color: #2E4d7B;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}

.accordionHeaderSelected {
border: 1px solid #2F4F4F;
color: white;
background-color: #5078B3;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
}

.accordionContent {
/*=====background-color: #D3DEEF;*/
background-color:aliceblue;
border: 1px none #2F4F4F;
border-top: none;
padding: 5px;
padding-top: 0px;
}

#mBody {
float:left;
margin-top:1px;
border:1px solid black;
height:100%;
width:100%;
}
#_Iframe {
margin-top:0px;
border:1px solid black;
width: 100%;
height:100%;

}
 
Share this answer
 
Use this code
link rel="stylesheet" type="text/css">
your css code here

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900