Click here to Skip to main content
15,907,183 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.
Sarvesh Kushwaha 10-Oct-12 2:12am    
you can get the screen size of user and then can design acording to that ....
Srivikas 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.
Srivikas 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.

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..
Share this answer
Srivikas 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
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") ||
Share this answer

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900