How to block mobile or smartphone browser access for clock in/out functions in asp.net

We've created a clock in/clock out page built using asp.net in vb, and we are trying to see how to add controls to block it for users trying to access the page on mobile browsers or outside networks.

We know we can restrict it to a single IP address, however, the organization the IP belongs to frequently changes their network IP  (as we've been told).

Any code set would be of help.

Please let me know if you have any further questions.

Thanks!
bpatton_psrAsked:
Who is Participating?
 
Roopesh ReddyIT AnalystCommented:
Hi,

Try this website - http://detectmobilebrowsers.com/

Hope it helps u...
0
 
CodeCruiserCommented:
One option is to look at the user agent string. But it could be faked on droids.
0
 
RouchieCommented:
A really simple trick would be to create a style sheet rule after all your other CSS data that hides the page for mobile devices.  Like this...


	<style type="text/css" media="screen">
	  normal CSS stuff here...
	</style>
	<style type="text/css" media="handheld">
		body { display: none; }
		html { display: none; }
		input { display: none; }
	</style>

Open in new window


I haven't actually tried this, and it MIGHT affect a few handheld devices such as tablets, but its no worse than checking for a user agent string, which as CodeCruiser rightly points out could be easily faked.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.