deltaflyer666
Programmer
I am trying to put together a site that will change style dependent upon the url data provided
The "Type" querystring value determines which data is returned from the database, i.e. type 1 = fish, type 2 = clothes, type 3 = spoons etc etc etc
I have the style sheet created that contains the styles wanted (example below)
[tt][highlight]
.color_fish{color:#FF0000;}
.color_clothes{color:#0000FF}
.color_spoons{color:#00FF00}
[/highlight][/tt]
based on the "Type" provided in the url i want to allocate different colors at runtime using the following code
[tt][highlight]
class='color_<% Response.Write(SiteColor(Request.Querystring("Type"))) %>'
[/highlight][/tt]
The sitecolor function simply does an if else statement to return the color needed for the "type" requested. i.e.
[tt][highlight]
if request.querystring("type") = "1" then
return "fish"
elseif request.querystring("type") = "2" then
return "clothes"
...
...
[/highlight][/tt]
Here is the question, The above response.write code embedded in the HTML works in normal asp.net 2.0 (i.e. type=1 font color=red, type=2 font color=blue etc) but how do i get this to work with Ajax inside an updatepanel?
Whenever the updatepanel is accessed i get an error saying response.write has altered the page. I don't want to create dozens of individual style sheets that can be applied server side at page load unless there is no alternative.
Any other (hopefully simpler) ideas?
The "Type" querystring value determines which data is returned from the database, i.e. type 1 = fish, type 2 = clothes, type 3 = spoons etc etc etc
I have the style sheet created that contains the styles wanted (example below)
[tt][highlight]
.color_fish{color:#FF0000;}
.color_clothes{color:#0000FF}
.color_spoons{color:#00FF00}
[/highlight][/tt]
based on the "Type" provided in the url i want to allocate different colors at runtime using the following code
[tt][highlight]
class='color_<% Response.Write(SiteColor(Request.Querystring("Type"))) %>'
[/highlight][/tt]
The sitecolor function simply does an if else statement to return the color needed for the "type" requested. i.e.
[tt][highlight]
if request.querystring("type") = "1" then
return "fish"
elseif request.querystring("type") = "2" then
return "clothes"
...
...
[/highlight][/tt]
Here is the question, The above response.write code embedded in the HTML works in normal asp.net 2.0 (i.e. type=1 font color=red, type=2 font color=blue etc) but how do i get this to work with Ajax inside an updatepanel?
Whenever the updatepanel is accessed i get an error saying response.write has altered the page. I don't want to create dozens of individual style sheets that can be applied server side at page load unless there is no alternative.
Any other (hopefully simpler) ideas?