Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET CSS
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 21:07pm
Comments
Sarvesh Kushwaha at 10-Oct-12 2:12am
   
you can get the screen size of user and then can design acording to that ....
 
http://www.javascriptkit.com/howto/newtech3.shtml
Member 9275533 at 10-Oct-12 2:30am
   
Thank You... I checked it and got an idea
Denno.Secqtinstien at 10-Oct-12 6:45am
   
http://www.alistapart.com/d/responsive-web-design/ex/ex-site-larger.html# is the best example of it.
Denno.Secqtinstien at 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 at 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
good
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..
  Permalink  
Comments
Member 9275533 at 10-Oct-12 2:43am
   
Can you please post the code for that
Denno.Secqtinstien at 10-Oct-12 6:12am
   
i think this link would be help full for you to do so
http://css-tricks.com/resolution-specific-stylesheets/
there are three demos and one download file which could help you understand the mythology for your moto design. cheers
Denno.Secqtinstien at 10-Oct-12 6:20am
   
alternatively can check
http://lessframework.com/#get
if you want to use a framework based css or may get helped from
http://www.ilovecolors.com.ar/detect-screen-size-css-style/
link
Rate this: bad
good
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") ||
    strUserAgent.Contains("palm"))
    {
    Response.Redirect("DefaultMobile.aspx");
    }
    }
  Permalink  
v2

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

  Print Answers RSS
0 DamithSL 305
1 OriginalGriff 295
2 Sergey Alexandrovich Kryukov 207
3 Peter Leow 175
4 Afzaal Ahmad Zeeshan 154
0 OriginalGriff 7,460
1 DamithSL 5,519
2 Sergey Alexandrovich Kryukov 4,954
3 Maciej Los 4,936
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 10 Oct 2012
Copyright © CodeProject, 1999-2014
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