Apply Different Css Based On Device?

Dec 16, 2010

I'm just starting to learn the basics of ASP.NET and have encountered a problem I don't know how to solve. I'm used to PHP and if I want a different css based on the device (Android or iPhone) used to browse my website i would do something like this:

<?php
#Check device used
$agent = $_SERVER['HTTP_USER_AGENT'];
if( strstr($agent, "Android") or strstr($agent, "iPhone") )
{
echo(" <link rel="stylesheet" type="text/css" media="screen" href="handheld.css" />
");
}
else
{
?>
<?php } ?>

But how is this done in asp.net? I have no clue.

View 1 Replies


Similar Messages:

C# - MVC Route Based On Web Browser / Device Like IPhone

May 27, 2010

Is it possible, from within ASP.NET MVC, to route to different controllers or actions based on the accessing device/browser? I'm thinking of setting up alternative actions and views for some parts of my website in case it is accessed from the iPhone, to optimize display and functionality of it. I don't want to create a completely separate project for the iPhone though as the majority of the site is fine on any device.

View 2 Replies

Is There A Way To Track A GPS Device Using PHP

Jun 2, 2010

In my upcoming project, I need to track GPS device attached to vehicles. Is there any way this is possible through PHP or ASP.Net

View 2 Replies

Mobiles :: Register Dll On Device?

Sep 19, 2010

I have an activex component on my webpage, which is built specifically fro Windows Mobile. This activeX component has a dll which needs to be registered on the device. How Do I register it?

View 1 Replies

C# - Read Sms From Mobile Device With .net Application?

Mar 16, 2010

How can I read SMS from mobile with my .net application? i have a Nokia 5310 mobile phone. Can you tell me from where i can download Nokia SDK or source code or Nokia API etc?

I want to make a custom application which reads SMS and at the same time sends a response to the sender's mobile number.

View 1 Replies

Server Interface With A Hardware Device?

Dec 14, 2010

I've currently developing a web application in asp.net and a smsgateway moderm connected to my server (currently my laptop). is there a way for the asp.net to interface with the moderm that is connected to the server? so i'll be able to send/receive message in a web interface

View 1 Replies

Control A Users USB Device Via A Webpage?

Feb 8, 2010

I'm wondering if there is a way to create an asp.net webpage that will connect a visitors USB device to an application on the windows bases server? This way we avoid having to install a software on the visitors computer to control a USB device update that they purchase form us.

All they have to do is visit our update page, plug their deivce to the USB, and have our site update the usb hardware. Possible? or am I dreaming? :)

i found software like: USB over IP, and few others. But not show ure its possible to create a C# or vb.net based ASP.net page to control the visitors USB device.

View 5 Replies

Mobiles :: Device Details With .net Code?

Mar 23, 2010

details of device by which I can get the input for GPS location independently without a fixed ic chip? I want to write the code myself for that then display on the screen; like many gps street locator or any other device available in market. I need initial level of code for chip and intial level code example for .net.

Apart from this I know the something about this like attach the device in the port . Detect the the port with device and read the data using API or dll whatever and start processing and then display on the output device.

View 1 Replies

Mobiles :: Call An Exe From Mobile Device?

Jul 21, 2010

I am working on a web mobile application in which i want to call an exe which is installed in the mobile from web application running on that mobile by clicking a link. How can i do that?

View 3 Replies

How To Alert A User Of A New Message Using Some Kind Of USB Device

Jan 18, 2010

I want to alert a user of a new message using some kind of USB device (e.g. a flashing light). Is it possible to control a USB device from ASP.NET or Silverlight?

View 3 Replies

How To Patch The Mobile Device Browser File

Jan 29, 2010

Nexus One is not currently supported by the Mobile Device Browser File, which leads to the Nexus One being identified as a non mobile device.

I know the user agent, and the capabilities are pretty similar to other Android terminals. With this information, how do I patch the MDBF to have the N1 be recognized as a mobile device?

View 3 Replies

Does The Mobile Device Browsing File Live On

Oct 26, 2010

[URL]

"Due to the organizational restructuring of the team that developed and supported the Mobile Device Browser file, we will no longer have the resources to support and update this CodePlex project. The team will be providing two more releases - one on the 27th July 2010 and the final release on the 24th August 2010. who used our product over the past year and a half. We would also like to thank everyone who contributed to the discussions and raised issues on our data."

Does this project live on someplace else or is there an equivelent project?

View 1 Replies

Mobiles :: Smart Device Project - Can Run On Emulator

Oct 8, 2010

I am working on a smart device project and want to run on emulator.i have completed the application.but now i want to run it on Emulator in vs2008.

View 1 Replies

Configuration :: Access A Hardware Device From The Client?

Oct 27, 2010

I am using Biometric Device for Login in my application. It is working fine when I am running it from Visual Studio 2008 on Server but when I am Publishing the Project and trying to run, it is not showing any popup for verifying thumb expression nor it is giving any error.

Also the published application should be able to run from different Workstations as well.

View 1 Replies

Mobiles :: Get Address Book From A Blackberry Device?

Dec 20, 2010

Is there any way to get the address book contacts from a blackberry device in a .net web application?We have a .net web application that can be accessible from a Blackberry device.What we need is a way of getting the Blackberry contacts list from a blacberry device the same way when you send an email:When you send an email you can type some characters on the "To" field then hit "enter" and the blackberry device is doing a lookup function returning a list of contacts based on the keywork you typed. Maybe there is a way of calling a blackberry API from a javascript function that would perform the same way described.

View 2 Replies

System.IO.IOException: The Device Is Not Ready Error?

Mar 25, 2011

I have written a code to write some information to text file and save this file on disk. However i have harcoded the path on which to save the file. I am getting System.IO.IOException: The device is not ready. error Is it because of that hardcoded the path. How to get path to folder on server?? On my local machine I am giving path "D:/telephone_management/AMS/files/" and within files folder i m saving my text files On server machine, the drvive is E, so path is wrong. Is there any way I can dynamically get path to my files folder on server ??

View 1 Replies

VS 2008 / SetFocus Not Working With One Mobile Device?

Sep 29, 2011

I have an asp.net website I wrote just for mobile devices. They all are running Windows Mobile 6.1 with Internet Explorer but they are different brand of devices such as PSION and others. On one device the site works great. I am using SetFocus in the code behind to set focus to buttons and textboxes after postbacks depending on the situation. On the other device the controls do not get the focus set.

Is there another method i should be using? I think I can set focus using javascript but can I call it at the end of a sub in the code behind? I'll have to look that up now.

View 1 Replies

Mobiles :: Change Aspx Pages For Blackberry Device

Jan 21, 2011

Mobile web is no longer supported in latest version of Visual Studio. Please do following with Vs2008 or VS2010

- Create standard ASP.NET website with standard "Web Forms"

- Design the content of web forms for your mobile pages based on device family that are
going to access your website. For e.g. iPhone, Andriod

- Add a detector process, which detects from where request is coming. If it is mobile than redirect user to mobile optimized pages.

- Different mobile has different capabilities (e.g screen size, image support, html support, xhtml support etc.). So it is very important that you know what type of device is trying to access your website and accordingly render required HTML/XHTML supported by the mobile device. [URL] So I have a basic website with .aspx pages. When they are on a blackberry the words wrap on top of the second line over the TEXTBOXES. Is there a basic place that can tell me how to fix this? Or what to use in the place of the CSS that are causing this on the blackberry devices?

View 2 Replies

Mobiles :: Obtain Mobile Device Screen Size?

Mar 16, 2010

I am trying to get the screenHeight and width:

[Code]....

but this is always show that the Height is 480 & the width is 640

I am trying on HTC with Opera Mobile 9.5

View 10 Replies

Mobiles :: Send A Get Method From Server To Device To Trigger

Mar 14, 2011

i have a gprs device that logs data to a webpage.i am using get method for the data transfer from device to web application. This function is working perfectly. what i want to do now is by clicking a button to send a get method from server to device in order to triggger it to do some actions. the device is correctly receiving the get method and sends a responce. The problem is that the http responce the device is sending might be wrong because the browser is waiting until timeout and then it displays the responce. does anyone knows what is the http responce format?

View 1 Replies

Control Adapters With Mobile Device Browser File?

Mar 1, 2010

I am using both the Mobile Device Browser File and a custom .browser file.

In the custom .browser file, there are several ControlAdapters registered. I would like to specify in my custom .browser file to use different ControlAdapters if the detected device is mobile (provided the Mobile Device Browser File lists it as mobile). How do I do that in my custom .browser file? I do not want to modify the Mobile Device Browser File.I am using something like this, but it is not working

<browser refID="Default">
<controlAdapters>
<adapter controlType="System.Web.UI.WebControls.Menu"[code].....

View 1 Replies

Mobiles :: Alternative To Mobile Device Browser File?

Jan 27, 2011

Since the mobile device browser file is no longer support, what is an alternative to it that requires minimum code changes?

View 2 Replies

Image Upload Taken By Mobile Device To File - Orientation?

Apr 29, 2016

It seems that when trying to upload(save) an image taken by a mobile device to file, the orientation gets messed up and you end up with images that are rotated 90 degrees to either side. This is an issue I am currently having.

Code:
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult AvatarEdit(HttpPostedFileBase NewAvatar)
{
//SAVE TO SERVER
string newid = Guid.NewGuid().ToString();

[Code] ....

Would I need to convert originalImage to a file type of HttpPostedFileBase or is there a more elegant way to save the file? I tried reconverting it to a stream and then saving it to file, but I failed miserably.

View 1 Replies

Mobiles :: Connect A USB Barcode Scanner To A Windows Mobile Device?

Jan 24, 2010

I have a ASP.Net application, that has barcode scanning functionality built into it.If a user is on regular computer like laptop or desktop, then I can simply connect the USB barcode scanner to the USB port and the barcode functionality works fine.But if a user is accessing the ASP.Net application over a windows mobile device, then how can a barcode scanner be connected to his/her mobile device?

View 1 Replies

Mobiles :: Can Create Windows Mobile Application Without Connecting Device

Mar 18, 2011

I am using Visual Studio 2008, I am new bie to create windows mobile application. I haven't installed Windows Mobile 6 SDK. I have started with built-in SDK and Emulators of VS 2008..

My question is, Can i create windows mobile application without connecting device ( Mobile or Pocket PC )?

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved