Solved

how to make the website resolution independent using asp.net?

Posted on 2006-10-30
12
1,081 Views
Last Modified: 2012-06-27
hi experts,
    I m making my project in asp.net.  I want to create the project resolution independent. I had tried it with tables but it became complicated when the project form had more controls. Is there any other way to do it so. Plz help me.

thanx
0
Comment
Question by:s_monani
  • 5
  • 3
12 Comments
 
LVL 12

Expert Comment

by:sandip132
ID: 17832447
just refer the html source code of www.yahoo.com.

use relative widths in your html code :  
<table border=0 cellpadding=0 cellspacing=0 width="100%">
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17835211
Asp.Net 2.0 has a facility called themes. This allows your site to has several 'Sets' of images (amongst other things) and a style sheet associated with each set. This set is called a theme and you can programatically set the theme on a user by user basis at runtime.

Basically what you need to do is design a set images and a style sheet for each resiolurion and store these as a theme in the App_themes folder. Then in the session on start event detect the users screen resolution (from the user agent in browser capabilities) and set the theme as appropriate (typically using a case statement).

For page layout you could either
 1) use a master page for each screen resolution (my favorite as it's easy and flexible)
 2) use a single master base based on percentages (can ork but difficult to develop and not very flexible - you might want to have a completly different layout for some browsers)
 3) use css positioning based on divs and stored in the style sheet (this the most PC and by far trhe bset but you'd need to be pretty good at CSS to pull it off)

If you want to get really advanced you could also put all your sites text into 'skin' files (these are part of the theme) and have these dynamically put on the page at run time. This works for really small browsers where you might want a less verbose version of you site to be displayed. It is also a technique that can be used for creatig a multi-lingual site.

The real beauty of this is that it's straight out of the box in asp.net 2.0


0
 
LVL 1

Author Comment

by:s_monani
ID: 17840501
hi,
thanx for u r reply. But can u plz tell me what is master page?
0
The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

 
LVL 11

Expert Comment

by:ethoths
ID: 17840649
Master pages are a new featutre of ASP.Net 2.0. Basically you can define a template (as master page) and define within it placeholders for content. Then you write your content pages that have just these content 'islands' and nothing else (except a reference to the master page). At run time the content islands are merged with the master page and the result is a normal asp.net page. The advantage is that the template is seperate and therefore when you change it you onluy have to change the one page. Another advantage is that you can programatically choose which master page to use so you can change the page layout on a page by page basis at runtime.

This is a very basic explanation but you can find dozens of detailled examples on the web.
0
 
LVL 1

Author Comment

by:s_monani
ID: 17847614
hi,

Can u send me some of the example links so that i can understand in a better way

thanx
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17848398
0
 
LVL 1

Author Comment

by:s_monani
ID: 17855862
hi,
    It was nice links as it had the very clear & easily understandable contents. But the problem is i m using asp.net 1.1 version. & Master pages are not supported by this version. So any  other option is there?

thanx

0
 
LVL 11

Accepted Solution

by:
ethoths earned 500 total points
ID: 17856722
You really should upgrade if you want to use these features. You caould implement these your self using a base page and inherit all your pages from it. Howvere, that is the old 1.1 way of doing things, it's difficult ot maintain and has poor design time support. Master pages and themes are two of the main reasins that MS wrote ASP.Net 2.0.

You can upgrade for free is cost is a limitation. The framework is free from and so is Visual Web Developer Express.

http://msdn.microsoft.com/vstudio/express/vwd/default.aspx
0
 
LVL 11

Expert Comment

by:ethoths
ID: 18006486
I beleive that I am owed the poijnts for this one. I have worked hard to explain the solution setp by step. The author agrees that this is the correct answer he's just not using ASP.Net 2.0.

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question