Link to home
Start Free TrialLog in
Avatar of karakav
karakav

asked on

ASP.NET: How to do without Doctype

Hi there,
I estensively use tables for positionning my control on the page (although I know the tables were not made for that). The default measurement of the controls in in percentage. I found ou that when I use Doctype, the table are rendered weird. Scroll bars appears without any need.
So decided to work without doctype.
Recentlty I was working with ModalPopupExtender and the result was worse. I use the css attached in the snippet as the background css class. The control works well but the background is really ugly. I put back doctype and things works  perfeclty as the Modal popup is concerned.
Can any one help me solve this without using DocType?
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

which doctype are you giving?

Can you also post the source code?
Thanks
Avatar of karakav
karakav

ASKER

I use this
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Something must be wrong with the tables. You should not remove the DOCTYPE to solve that problem because it would cause other problems as you have already experienced. You would also face problems when you get to the multiple browser testing as without DOCTYPE each browser would render the same code differently because it won't know what standard to use. Have you tried the default DOCTYPE that the VS uses

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Avatar of karakav

ASKER

amit_q, I used the doctype you recommend but the textboxes and dropdownlist render weird.
Can't say why they are looking weird but removing the doctype is not a good idea. Do you have it online for us to see. Also what browser are you targeting/testing?
Avatar of karakav

ASKER

Just give me time to make a sample page as I am not allowed to make public the project I am working on.

I am targetting IE6 to IE8 and Firefox 2.0 and above
Since you are targeting these browsers (IE6 and IE8 are quite different), you can't afford to drop DOCTYPE. Without that each browser would render it differently. For IE6 you would have to anyway make some extra efforts to render properly anyway. I would recommend testing first in IE8/FF3. Both of these follow standards. Then you can apply the updates/hacks for the IE6.
Avatar of karakav

ASKER

Here is the code. I made a project with one page. I included a theme on the project as my self use them. For the website to be operational, you need to remove the txt extention on the following files:
- Default.aspx.cs.txt
- Default.aspx.txt
- web.config.txt
- SkinFile.skin.txt

You need also the add a reference to the ajaxcontroltookit dll file.

I am sorry for the incoveniences but I wanted to provide the closest picture of the problem.

The try to run the website with and then without the doctype, to see the difference in the rendering.

Thanks in advance.
TestSite.zip
Looks same with DOCTYPE and without it in both IE8 an FF. I noticed that you are using the older version of assemblies

System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

the latest version is

System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35

Also what are using to develop?
Avatar of karakav

ASKER

It doesn't look the same. Pay attention to the sizes of the controls. Without doctype, they render well aligned.

I use Visual Studio 2005 to develop.
ASKER CERTIFIED SOLUTION
Avatar of amit_g
amit_g
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of karakav

ASKER

Thanks