HtmlTextWriter
-
Hi, i need to paste CSS style definition to my Asp.Net control (in
Render()
method), but i think, that<style>...</style>
should be between<head>
and</head>
:confused: i don't know how to insert my code into <head> Thank you -
Hi, i need to paste CSS style definition to my Asp.Net control (in
Render()
method), but i think, that<style>...</style>
should be between<head>
and</head>
:confused: i don't know how to insert my code into <head> Thank youI don't think there's the way to do that. For myself I put the <STYLE> tag directly in .aspx file. However, you can use ASP display tag <%=%> to put the style text in the header. By declaring a protected/public variable in your code-behind file and place that variable (with ASP display tag) in between <HEAD> tag in .aspx file. That should work... :) Ruxo Zheng
-
Hi, i need to paste CSS style definition to my Asp.Net control (in
Render()
method), but i think, that<style>...</style>
should be between<head>
and</head>
:confused: i don't know how to insert my code into <head> Thank you... MyStyle.InnerText = "The Css Rules You Want"; ...
-
Hi, i need to paste CSS style definition to my Asp.Net control (in
Render()
method), but i think, that<style>...</style>
should be between<head>
and</head>
:confused: i don't know how to insert my code into <head> Thank youHere what I have in my templete page and it worx great for me, no designer support, but it works.
protected override void OnInit(EventArgs e)
{
LiteralControl cont = (LiteralControl) Controls[0];
int headend = cont.Text.LastIndexOf("");
string css = "".Replace("'","\"");
cont.Text = cont.Text.Insert(headend, css);
cont.Text = cont.Text.Replace("AS you can see I have a header and a footer control on each page, also a drop all controls from the inherited page, into the a panel.
Hope this helps :)
"I dont have a life, I have a program." Also, I won't support any software without the
LeppieRules
variable. -
Hi, i need to paste CSS style definition to my Asp.Net control (in
Render()
method), but i think, that<style>...</style>
should be between<head>
and</head>
:confused: i don't know how to insert my code into <head> Thank youThank you all. I think, that i can't change existing generated code in control derived from
System.Web.UI.WebControls.WebControl
. But when i insert<style>...</style>
into<body>..</body>
it works fine :cool: -
Thank you all. I think, that i can't change existing generated code in control derived from
System.Web.UI.WebControls.WebControl
. But when i insert<style>...</style>
into<body>..</body>
it works fine :cool: