Click here to Skip to main content
15,902,299 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.
Posted
Comments
Sarvesh Kushwaha 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
Srivikas 10-Oct-12 2:30am    
Thank You... I checked it and got an idea
Denno.Secqtinstien 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 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.

XML
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");
    }
    }
 
Share this answer
 
v2
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
 
Comments
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
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 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

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