473,396 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

change user interface dynamically using css files

Dear Friends
I need to change the css file of my aspx files dynamically so users can
choose their css file names and when page loads, it read css file name from
database.
I try to use response.write to write this way:
Dim i As Integer = 1
If i = 1 Then
Response.Write("<LINK href=""Stylesone.css"" type=""text/css""
rel=""stylesheet"">")
Response.Write("<script language =""javascript"" src = ""testone.js"">
</script>")
Else
Response.Write("<LINK href=""Stylestwo.css"" type=""text/css""
rel=""stylesheet"">")
Response.Write("<script language =""javascript"" src = ""testtwo.js"">
</script>")
End If
but you know, the ealiest time I can use this is page load event that
writes that string at the top of generated html file that works but is there
a way I can write this string in the head tage not at first line of
generated html.
Also, it there a better way to change the user interface dynamically (based
on users preferences and types) like XML, XSL, XSLT,...
Thanks in advance

Amir Eshterayeh
ae*********@hotmail.com

Jul 21 '05 #1
1 2037
Jos
Amir Eshterayeh wrote:
Dear Friends
I need to change the css file of my aspx files dynamically so
users can choose their css file names and when page loads, it read
css file name from database.
I try to use response.write to write this way:
Dim i As Integer = 1
If i = 1 Then
Response.Write("<LINK href=""Stylesone.css"" type=""text/css""
rel=""stylesheet"">")
Response.Write("<script language =""javascript"" src =
""testone.js""> </script>")
Else
Response.Write("<LINK href=""Stylestwo.css"" type=""text/css""
rel=""stylesheet"">")
Response.Write("<script language =""javascript"" src =
""testtwo.js""> </script>")
End If
but you know, the ealiest time I can use this is page load event that
writes that string at the top of generated html file that works but
is there a way I can write this string in the head tage not at first
line of generated html.
Also, it there a better way to change the user interface dynamically
(based on users preferences and types) like XML, XSL, XSLT,...
Thanks in advance

Amir Eshterayeh
ae*********@hotmail.com


You can change the <head> tag into an HTML control like this:
<head id="myhead" runat="server">
...permanent content here...
</head>

Then, you can modify it from code like this:
Sub Page_Load(sender As Object, e As EventArgs)
myhead.InnerHtml &="<LINK href=""Stylesone.css"" type=""text/css""
rel=""stylesheet"">"
End Sub

--

Jos Branders
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: techie | last post by:
Hi All, I have a portal working on an intranet for a company. The portal was designed keeping in mind the resolution of 1024*768. I am including a ..css file in all the files. Now i have to make...
4
by: Richard Cornford | last post by:
For the last couple of months I have been trying to get the next round of updates to the FAQ underway and been being thwarted by a heavy workload (the project I am working on has to be finished an...
1
by: TIM T | last post by:
I want to load a user control from a dll dynamically to my main form. I have been reading about using reflection. I got this to work with the methods from my other classes in the dll but I am not...
2
by: Amir Eshterayeh | last post by:
Dear Friends I need to change the css file of my aspx files dynamically so users can choose their css file names and when page loads, it read css file name from database. I try to use...
6
by: Earl Teigrob | last post by:
I am writing an application that dynamically loads user controls at run time based on user options. I would like to give my users the ability to build their own user controls and add them to my...
1
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a...
3
by: voro.cibus | last post by:
I have been reading up on this all day, and I can't find the answer (or more likely, don't understand the answers I have found) to my problem. I have a table that stores the name of my ascx page....
7
by: Samuel | last post by:
Hi, I am building a page that makes use of user control as a templating technique. The following is that I have in mind and it is actually working: Root/ -- login.aspx -- login.aspx.vb --...
3
by: JJ | last post by:
Whats the best way to convert a user control to a custom server control? i.e. I created a .aspx control using the designer to create the look of the control. I now want to use this in other...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.