473,327 Members | 1,952 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,327 software developers and data experts.

ASP Detection Code for Multiple Web Pages

Currently, only the index page is .asp and has code in the header to detect mobile devices. So if someone goes to our website on a mobile phone they are redirected to the mobile site. All the other pages are .html. If someone uses google search and happens to find a page deeper within our site, and they are on a mobile device, then they get the regular website page. We need them to get the mobile equivalent of that searched page, since they are on mobile.

Is there a way to use a single .asp page to detect mobile devices for all our web pages? Or does each web page need to be .asp and have the redirect code in the header as our homepage does?

One reason for wanting only one asp page is so that if there are changes to the detection code, it only has to be done in one place... not on every single webpage.

We are using IIS. We have the mobile site under a folder called mobile separate from the regular website... so pointing to it is easier if need be.

If more specifics are needed... let me know.
Oct 31 '07 #1
1 1532
markrawlingson
346 Expert 100+
One reason for wanting only one asp page is so that if there are changes to the detection code, it only has to be done in one place... not on every single webpage.
That's why functions and subroutines were invented, but unfortunately not many people know how to effectively harness their power...

Personally, I have a functions include which contains a long list of functions and subroutines which perform often rudimentary tasks - but can be called in any webpage very easily - and if i ever need to update any of the functions I CAN do this is one place, rather than editing every page in my website(s). If I need to add a function, I can also do this in one place - and the function will be accessible by all my webpages without having to go into each one and add the function/code.

Anyway, one possible solution to your problem is to have a seperate ASP page in the back-end that only contains the code for checking the mobile phone, etc and redirecting. You could use AJAX on all of your .html pages, which would basically consist of javascript (which will, of course, run in an html file) - will call your ASP page in the background, and based on the result you can redirect the user.

Sincerely,
Mark
Oct 31 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

60
by: Fotios | last post by:
Hi guys, I have put together a flexible client-side user agent detector (written in js). I thought that some of you may find it useful. Code is here: http://fotios.cc/software/ua_detect.htm ...
8
by: __jakal__ | last post by:
Hello, Is there any good memory leak detection software for C++ available as a freeware... I had used purify but had to discontinue due to huge license fees... Also tried Sun workshop memory...
6
by: Frank Esser | last post by:
Hallo, I've got a project with about 10 pages. On each of them the user can do data changes (mostly datagrid interactions; the datagrids are bound to datasets). The user is able to jump to...
5
by: Dave H | last post by:
I have an asp:listbox, allowing multiple selections, is there a quick check to see if there's more than one selected, or do I need to go through the whole list? Thanks, Dave
13
by: Matik | last post by:
Hello everybody, First: SQL Server 2000 sp3a, HP cluster server, MS 2003 server, database recovery model simple Torn page detection: When I have this option turned on, processes conected with...
7
by: Csaba Gabor | last post by:
I'd like to detect the shift key when a button is "clicked" in Firefox/Mozilla. If the button is clicked with the mouse, no problem. However, if the onclick event is keyboard originated, then my...
2
by: petermichaux | last post by:
Hi, I don't know if there is a way to feature detect for this or not. I have a list and the user can click on items to select. I would like that they can command-click on Mac or control-click on...
10
by: Conrad Lender | last post by:
In a recent thread in this group, I said that in some cases object detection and feature tests weren't sufficient in the development of cross-browser applications, and that there were situations...
2
by: Johnson | last post by:
While I have done a substantial amount of ASP.NET programming, I have only dabbled with AJAX (update panels and a 3rd party JSON setup - jayrock - that directly updates the DOM). In any case, I'm...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.