473,383 Members | 1,821 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,383 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 2036
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.