Click here to Skip to main content
13,048,584 members (95,692 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi friends, I need to design an ASP.NET(using C#) Website which can be used on computers as well as mobile phones. But the design should be different for the two environments. Is it possible to achieve this using a single aspx page. Please reply asap.
Posted 9-Oct-12 20:07pm
Sarvesh Kushwaha 10-Oct-12 2:12am
you can get the screen size of user and then can design acording to that ....
Member 9275533 10-Oct-12 2:30am
Thank You... I checked it and got an idea
Denno.Secqtinstien 10-Oct-12 6:45am is the best example of it.
Denno.Secqtinstien 10-Oct-12 2:27am
i have used the same code to show the pages for different sizes but its too long might be in need to refresh my diskettes for the code (i used to back up my codes in the form of a cd), if found would give you. till then you ca google for the code.
Member 9275533 10-Oct-12 2:33am
Thank You for your concern. I am in the process of designing database for my web site. So it may take some more time to reach that stage. So please post the code if you find free to check your diskettes. Or else I shall google it at that time.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

you would be required to capture the resolutions of the devices you are using and based on that you would be required to define the css files. so that when a user calls the url of your website it first has to check for the type of the device and then has to populate the page as per your choosen css's designs..
Member 9275533 10-Oct-12 2:43am
Can you please post the code for that
Denno.Secqtinstien 10-Oct-12 6:12am
i think this link would be help full for you to do so
there are three demos and one download file which could help you understand the mythology for your moto design. cheers
Denno.Secqtinstien 10-Oct-12 6:20am
alternatively can check
if you want to use a framework based css or may get helped from
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

its better you develop a mobile web page for mobile devices .
you can detect a mobile device using following code in the page load :
<pre lang="c#">
    string strUserAgent = Request.UserAgent.ToString().ToLower();
    if (strUserAgent != null)
    if (Request.Browser.IsMobileDevice == true || strUserAgent.Contains("iphone") ||
    strUserAgent.Contains("blackberry") || strUserAgent.Contains("mobile") ||
    strUserAgent.Contains("windows ce") || strUserAgent.Contains("opera mini") ||

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 10 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100