Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 31st, 2004, 03:48 AM
Authorized User
 
Join Date: Jul 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default changing text size on screen

hi all
i have two css files that i can call depending on a parameter i send with each page. the problem is that i have a footer.inc include file at the bottom of every page in my application where i want to have the links, click here for bigger/smaller text. but how can i dynamically sent the output of the link to the current page. ie one user may be on page1.asp and click on the link for larger text so the link would have to be page1.asp?text=large while another user could be on page5.asp and the link here would have to be page5.asp?text=large. is there any way that i can get the current page or is there any way to do this? how is this normally done(i think through java script but not sure)?

Slán
~M
____
Mark

Mark Hardiman
Senior Developer
Kernel Software Ltd
 
Old August 31st, 2004, 04:36 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

There are many ways to do it.

One way is to store the textsize in session. Then depending on the value in session, you can load appropriate css file.

The other method is a cumbersome one. The following script will be included in all pages.

dim str_text_size
if(Request.QueryString("text")="large") then
    str_text_size="large"
else
    str_text_size=""
end if

Then all the links should be appended with the querystring ?text=<%=str_text_size%>. All form actions should also be changed to include this querystring.

Obviously, the first one is easier. But it has some efficiency problems. When large number of persons visit the site, the session will consume large resources.
 
Old August 31st, 2004, 05:25 AM
Authorized User
 
Join Date: Jul 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi
I already have the code working that selects the correct css file to use, it is almost identical to what you have posted here. what i need is a way that on the bottom of the page i can have a link that says something like
dim current_page_name
current_page_name = this_page_name
href = "current_page_name".asp?text=large
i need to be able to set current_page_name depending on the actual page that the user is on as this is just one piece of cede that i include at the bottom of every page. i have about 50/60 pages on the site and i don't fancy maintaining all the code in them which is why i use css and include files.

Slán
~M
____
Mark

Mark Hardiman
Senior Developer
Kernel Software Ltd
 
Old August 31st, 2004, 05:45 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

If your requirement is to get the name of surrent page, you can use the following idea.

Request.ServerVariables("SCRIPT_NAME") gives the path of the script in relation to the virtual root. For. e.g. if http://www.yoursite.com/user/new/test1.asp is the page, then Request.ServerVariables("SCRIPT_NAME") will give /user/new/test1.asp.

Out of this value, you can find the position of last /. The function instrrev will help you for it. Then you can use mid function to extract the filename.

I hope that is clear.
 
Old August 31st, 2004, 07:01 AM
Authorized User
 
Join Date: Jul 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thats exactly what i was looking for
thanks
Slán
~M
____
Mark

Mark Hardiman
Senior Developer
Kernel Software Ltd





Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing screen resolution snufse ASP.NET 2.0 Basics 0 January 22nd, 2008 10:08 AM
Screen Size and Java Script srotondo Classic ASP Professional 5 December 20th, 2004 07:24 PM
Size of Screen cinest General .NET 2 October 8th, 2004 03:33 AM
Screen Size bmains VB.NET 11 June 28th, 2004 02:41 AM
Changing the screen resolution Dmitriy Pro VB 6 1 March 26th, 2004 05:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.