Joubert Nel
2005-12-23 22:27:57 UTC
Hi,
I have an XHTML document that I wish to display to the user in the .NET 2.0 WebBrowser control, and allow the user to edit it.
I got everything working beautifully but noticed that the control tampers with the !DOCTYPE definition.
Here is the XHTML that I pass to the WebBrowser control:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>HtmlEditor</title>
<style type="text/css">
BODY {font-family:Tahoma; font-size:10pt; color:#000000; font-weight:400; PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px}
</style>
</head>
<body>
</body>
</html>
As you can see, this is simply a template, giving the user a blank slate where they can now edit.
However, after the above snippet is loaded by the WebBrowser (I use the .Document.OpenNew(); and then .Document.Write(".....") methods) the !DOCTYPE is changed to:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Does anybody know why this is happening, what the potential effects are, and how I can resolve?
Thanks
Joubert
I have an XHTML document that I wish to display to the user in the .NET 2.0 WebBrowser control, and allow the user to edit it.
I got everything working beautifully but noticed that the control tampers with the !DOCTYPE definition.
Here is the XHTML that I pass to the WebBrowser control:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>HtmlEditor</title>
<style type="text/css">
BODY {font-family:Tahoma; font-size:10pt; color:#000000; font-weight:400; PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px}
</style>
</head>
<body>
</body>
</html>
As you can see, this is simply a template, giving the user a blank slate where they can now edit.
However, after the above snippet is loaded by the WebBrowser (I use the .Document.OpenNew(); and then .Document.Write(".....") methods) the !DOCTYPE is changed to:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Does anybody know why this is happening, what the potential effects are, and how I can resolve?
Thanks
Joubert