Click here to Skip to main content
15,915,603 members
Home / Discussions / C#
   

C#

 
QuestionGenerics and Indexers [modified] Pin
cechode28-Jul-06 13:00
cechode28-Jul-06 13:00 
AnswerRe: Generics and Indexers Pin
leppie28-Jul-06 16:09
leppie28-Jul-06 16:09 
QuestionRedirecting outputs if Process.Start is used. Pin
Cadence2.028-Jul-06 9:38
Cadence2.028-Jul-06 9:38 
AnswerYes Pin
Ennis Ray Lynch, Jr.28-Jul-06 9:58
Ennis Ray Lynch, Jr.28-Jul-06 9:58 
GeneralRe: Yes Pin
Cadence2.028-Jul-06 11:05
Cadence2.028-Jul-06 11:05 
GeneralSome sample code Pin
Cadence2.028-Jul-06 12:09
Cadence2.028-Jul-06 12:09 
QuestionDeployment Project question needs urgent answer Pin
wasife28-Jul-06 7:46
wasife28-Jul-06 7:46 
QuestionHow to add stylesheet using code-behind [modified] Pin
Rukmini T28-Jul-06 7:26
Rukmini T28-Jul-06 7:26 
Hi,
I am having problem in writing the stylesheet using C# code-behind. I have written a code, but it is not affecting my pages. Can any one please tell me how to write... This is the code





/*<![CDATA[*/
#banner { background-image:url../images/banner1.jpg) }
#splash{background-image:url(../images/active_bg.jpg) }
/*]]>*/



and I have written like this....

protected void Page_Init(object sender, EventArgs e)
{
HtmlLink link = new HtmlLink();
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
link.Href = "~../Css/landing.css";
Page.Controls.Add(link);

HtmlLink linkMain = new HtmlLink();
linkMain.Attributes.Add("type", "text/css");
linkMain.Attributes.Add("rel", "stylesheet");
linkMain.Href = "#banner{ background-image:url(../images/banner1.jpg) }";
Page.Controls.Add(linkMain);

HtmlLink linkSplashButtons = new HtmlLink();
linkSplashButtons.Attributes.Add("type", "text/css");
linkSplashButtons.Attributes.Add("rel", "stylesheet");
linkSplashButtons.Href = "#splash{ background-image:url(../images/active_bg.jpg) }";
Page.Controls.Add(linkSplashButtons);
}

Can anyone please tell me how to write this


Regards
Rukmini


-- modified at 13:27 Friday 28th July, 2006
AnswerRe: How to add stylesheet using code-behind [modified] Pin
eggsovereasy28-Jul-06 7:36
eggsovereasy28-Jul-06 7:36 
GeneralRe: How to add stylesheet using code-behind Pin
Rukmini T28-Jul-06 7:49
Rukmini T28-Jul-06 7:49 
GeneralRe: How to add stylesheet using code-behind Pin
eggsovereasy28-Jul-06 8:56
eggsovereasy28-Jul-06 8:56 
GeneralRe: How to add stylesheet using code-behind Pin
Rukmini T28-Jul-06 9:23
Rukmini T28-Jul-06 9:23 
Questionc program mini project Pin
haarika reddy28-Jul-06 7:18
haarika reddy28-Jul-06 7:18 
AnswerRe: c program mini project Pin
Ravi Bhavnani28-Jul-06 10:18
professionalRavi Bhavnani28-Jul-06 10:18 
AnswerRe: c program mini project Pin
likefood28-Jul-06 13:58
likefood28-Jul-06 13:58 
AnswerRe: c program mini project Pin
stancrm28-Jul-06 18:32
stancrm28-Jul-06 18:32 
QuestionAttaching a database with my C# application Pin
wasife28-Jul-06 5:45
wasife28-Jul-06 5:45 
AnswerRe: Attaching a database with my C# application Pin
Steve Maier28-Jul-06 9:55
professionalSteve Maier28-Jul-06 9:55 
QuestionDataGridViewImageColumn Pin
e_LA28-Jul-06 4:56
e_LA28-Jul-06 4:56 
AnswerRe: DataGridViewImageColumn Pin
Judah Gabriel Himango28-Jul-06 6:06
sponsorJudah Gabriel Himango28-Jul-06 6:06 
GeneralRe: DataGridViewImageColumn Pin
e_LA30-Jul-06 22:24
e_LA30-Jul-06 22:24 
GeneralRe: DataGridViewImageColumn Pin
Judah Gabriel Himango31-Jul-06 6:02
sponsorJudah Gabriel Himango31-Jul-06 6:02 
GeneralRe: DataGridViewImageColumn Pin
e_LA31-Jul-06 21:31
e_LA31-Jul-06 21:31 
GeneralRe: DataGridViewImageColumn Pin
e_LA31-Jul-06 23:24
e_LA31-Jul-06 23:24 
GeneralIt works Pin
e_LA1-Aug-06 1:26
e_LA1-Aug-06 1:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.