When I do 'source view' in my browser I realize that all xhtml that I provide between <head> tag are 'reformatted' by asp.net mvc engine, that is, my indentation is lost. The exception seems to be with <script> tag.
Is there any way to force asp.net to respect my indentation?
Best Regards,
David H.H.Lee
----------------------------------------------------
Please click “Mark as Answer” on the post that assist you solve the problem.
In the default MVC template the <head> tag in the Site.master file (in the ~/Views/Shared folder) is marked as runat="server". This special attribute gives the tag additional behavior that in some cases is nice, and in other cases it can cause formatting
problems. You can remove the runat="server" attribute from the <head> tag but that can cause certain URLs to map incorrectly.
Is the difference in indentation causing any issues or is it just "ugly"?
Thanks,
Eilon
Blog: http://weblogs.asp.net/LeftSlipper/
Marked as answer by ricka6 on Oct 20, 2009 08:15 PM
Paulo Abreu
Member
6 Points
11 Posts
XHTML header indentation format is not respected for some tags
Oct 16, 2009 07:50 AM|LINK
Hello,
When I do 'source view' in my browser I realize that all xhtml that I provide between <head> tag are 'reformatted' by asp.net mvc engine, that is, my indentation is lost. The exception seems to be with <script> tag.
Is there any way to force asp.net to respect my indentation?
Regards,
Paulo Abreu
x_com
Member
282 Points
46 Posts
Re: XHTML header indentation format is not respected for some tags
Oct 16, 2009 10:35 AM|LINK
Hi,
Try this XHML's doctype:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Check this link for further details:
http://www.lassosoft.com/Documentation/TotW/index.lasso?8991
David H.H.Lee
----------------------------------------------------
Please click “Mark as Answer” on the post that assist you solve the problem.
Paulo Abreu
Member
6 Points
11 Posts
Re: XHTML header indentation format is not respected for some tags
Oct 16, 2009 11:27 AM|LINK
Hello, thank you for you attention.
Unfortunatly is not a doctype problem. I tryed your tip and didn't work. I am using XHTML 1.0 Strict.
Regards,
Eilon
Contributor
5753 Points
976 Posts
Microsoft
Re: XHTML header indentation format is not respected for some tags
Oct 20, 2009 05:39 PM|LINK
Hi Paulo,
In the default MVC template the <head> tag in the Site.master file (in the ~/Views/Shared folder) is marked as runat="server". This special attribute gives the tag additional behavior that in some cases is nice, and in other cases it can cause formatting problems. You can remove the runat="server" attribute from the <head> tag but that can cause certain URLs to map incorrectly.
Is the difference in indentation causing any issues or is it just "ugly"?
Thanks,
Eilon
Paulo Abreu
Member
6 Points
11 Posts
Re: XHTML header indentation format is not respected for some tags
Oct 20, 2009 10:47 PM|LINK
Hello Eilon.
I'm not having any issue. It's "ugly".
I really don't like that kind of magic
Thank you for your reply.
Paulo Abreu