473,383 Members | 1,742 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

Nov 18 '05 #1
2 4103
Hi,

Yes, you can use XML Control with XSLT to create dynamic content :
http://builder.com.com/5100-6373-1050062-2.html

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2
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
Nov 18 '05 #3

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...
1
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...
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...
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: jehugaleahsa | last post by:
Hello: We are implementing a work flow system. We would like there to be one site hosting all the different work flows. Each state in the work flow is to be associated with a web user control...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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.