473,320 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

asp.net and XHTML

How can I stop asp.net from rendering XHTML istead of HTML?
My javascripts are rendering wrong because of that. It is rendering & to
clients instead of &.
Any help?
Thanks,
Alejandro.
Nov 19 '05 #1
12 2374
How do you render your scripts ?

Patrice

--

"Alex D." <al********@hotmail.com> a écrit dans le message de
news:uq**************@TK2MSFTNGP10.phx.gbl...
How can I stop asp.net from rendering XHTML istead of HTML?
My javascripts are rendering wrong because of that. It is rendering &amp; to clients instead of &.
Any help?
Thanks,
Alejandro.

Nov 19 '05 #2
like this:

this.txtUserName.Attributes.Add("onkeydown","if((e vent.which && event.which
== 13)||(event.keyCode && event.keyCode ==
13)){document.Form1.cmdLogin.click();return false;}else return true;");

that code rendered javascript to the client OK. Now that I upgraded to
ASP.NET 2 Beta 2 it is rendering &amp;&amp; instead of &&, so clients are
getting this instead:

if((event.which &amp;&amp; event.which == 13)||(event.keyCode &amp;&amp;
event.keyCode == 13)){document.Form1.cmdLogin.click();return false;}else
return true;

"Patrice" <no****@nowhere.com> wrote in message
news:uL**************@TK2MSFTNGP09.phx.gbl...
How do you render your scripts ?

Patrice

--

"Alex D." <al********@hotmail.com> a écrit dans le message de
news:uq**************@TK2MSFTNGP10.phx.gbl...
How can I stop asp.net from rendering XHTML istead of HTML?
My javascripts are rendering wrong because of that. It is rendering &amp;

to
clients instead of &.
Any help?
Thanks,
Alejandro.


Nov 19 '05 #3
Alex D. wrote:
How can I stop asp.net from rendering XHTML istead of HTML?
My javascripts are rendering wrong because of that. It is rendering
&amp; to clients instead of &.
Any help?


ASP.NET 1.x does not render XHTML. &amp; is correct HTML.

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #4
maybe is correct HTML but definitly is not correct javascript.
I am using ASP.NET 2 Beta 2. My code worked OK when using ASP.NET 1.x

"Joerg Jooss" <ne********@joergjooss.de> wrote in message
news:xn****************@msnews.microsoft.com...
Alex D. wrote:
How can I stop asp.net from rendering XHTML istead of HTML?
My javascripts are rendering wrong because of that. It is rendering
&amp; to clients instead of &.
Any help?


ASP.NET 1.x does not render XHTML. &amp; is correct HTML.

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de

Nov 19 '05 #5
As noted by Joerg, this is HTML not XHTML...

If it really causes a problem you could register the client script using the
"ClientScript" member of the page class and just make the call using
Attributes.Add. Here you render the script as an HTML attribute causing the
string to be HTML encoded (likely ASP.NET doesn't check anyhting, this is an
HTML attribute then it encodes it)...

Let us know about your findings (especially if using HTML encoded scripts
causes a problem on some browsers)...

Patrice

--

"Alex D." <al********@hotmail.com> a écrit dans le message de
news:OJ**************@TK2MSFTNGP09.phx.gbl...
like this:

this.txtUserName.Attributes.Add("onkeydown","if((e vent.which && event.which == 13)||(event.keyCode && event.keyCode ==
13)){document.Form1.cmdLogin.click();return false;}else return true;");

that code rendered javascript to the client OK. Now that I upgraded to
ASP.NET 2 Beta 2 it is rendering &amp;&amp; instead of &&, so clients are
getting this instead:

if((event.which &amp;&amp; event.which == 13)||(event.keyCode &amp;&amp;
event.keyCode == 13)){document.Form1.cmdLogin.click();return false;}else
return true;

"Patrice" <no****@nowhere.com> wrote in message
news:uL**************@TK2MSFTNGP09.phx.gbl...
How do you render your scripts ?

Patrice

--

"Alex D." <al********@hotmail.com> a écrit dans le message de
news:uq**************@TK2MSFTNGP10.phx.gbl...
How can I stop asp.net from rendering XHTML istead of HTML?
My javascripts are rendering wrong because of that. It is rendering
&amp; to
clients instead of &.
Any help?
Thanks,
Alejandro.



Nov 19 '05 #6
Alex D. wrote:
maybe is correct HTML but definitly is not correct javascript.
I am using ASP.NET 2 Beta 2. My code worked OK when using ASP.NET 1.x


Note that the HTML output of ASP.NET 1.x was, um, kinda crappy. So
saying "it worked" doesn't imply it was correct :-/

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #7
my friend, I get the same problem even if I insert the code here:

<FORM id=Form1 method=post runat="server" onload=
"if((event.which && event.which== 13)||(event.keyCode && event.keyCode ==
13)){document.Form1.cmdLogin.click();return false;}else return true;");>

but if I insert the code BEFORE the FORM tag , let say, inside the BODY,
then it render & instead of &amp; which is OK. SO it is an XHTML related
problem

If you are interested you can read this, I tried the suggested solution to
disable XHTML but it didn't work.

ASP.NET and XHTML Compliance
ASP.NET allows you to create Web pages that are compliant with XHTML 1.1
standards. XHTML is a W3C standard that defines HTML as an XML document.
Creating Web pages that are conformant with XHTML standards guarantees that
the elements in the pages are well formed. Because many browsers are moving
toward supporting XHTML, creating pages that conform to XHTML standards
helps ensure that your pages will be compatible with browsers in the future.
XHTML is also extensible, allowing the definition of new elements. Finally,
an XHTML page is much easier to read programmatically for situations in
which the Web page is processed by a computer rather than read by users, and
the document can be manipulated using transformations. For more information
about the XHTML standard, see the W3C site at www.w3.org/TR/xhtml1.

Compliance Features
XHTML defines elements and attributes more strictly than HTML. By default,
all markup produced by ASP.NET and Web server controls included with ASP.NET
now conforms to this standard.

Some of the XHTML rules that differ from HTML include the following:

a.. All elements either include an explicit closing tag or are
self-closing (with />).

b.. Tag and attribute names are rendered in lowercase, and attribute
values are included in double quotation marks. For example, if you use a
System.Web.UI.WebControls.GridView control on your page, when the page is
rendered, the System.Web.UI.WebControls.GridView control emits HTML that is
XHTML compliant. All generated elements use explicit opening and closing
tags (or self-closing tags), and attribute values are included in double
quotation marks.

c.. Formatting information is rendered using only cascading style sheet
styler. To support this standard, ASP.NET controls do not render <font> tags
or attributes such as bgcolor.

d.. Controls do not render custom attributes (expando attributes) that are
not defined in the XHTML standards.

e.. In ASP.NET, if controls generate IDs, as occurs in the Repeater,
GridView, and other controls, the format of the IDs is XHTML 1.1 compliant.

f.. ASP.NET dynamically adds an action attribute to the form tag. Because
XHTML 1.1 prohibits it, form tags do not include a name attribute.

g.. Because XHTML requires all elements to be enclosed in a container
element, ASP.NET controls such as input elements are rendered in div
elements. This includes the HTML markup rendered for controls such as the
TextBox, CheckBox, and RadioButton controls. It also includes hidden fields,
such as the element used to store view-state data.

h.. ASP.NET codes characters such as & (for example, as &amp;). This
includes URLs that are generated to reference JavaScript script and the
contents of encoded values such as view state.

i.. Any script tags rendered into the page include an appropriate type
attribute. (This pertains to scripts that are created by the page or
controls or by the RegisterHiddenField, RegisterStartupScript, and
RegisterClientScriptBlock methods; script blocks that you create are not
automatically amended with a type attribute.) In ASP.NET any script tags
rendered by the page use the appropriate type attribute
(type="type/javascript") and do not include a language attribute. ASP.NET
renders script tags when the page includes certain controls (such as the
System.Web.UI.WebControls.HyperLink , System.Web.UI.WebControls.LinkButton ,
and System.Web.UI.WebControls.Calendar controls) that require client script
to perform a postback. Script is also rendered for controls that rely on
client-side functionality, such as the System.Web.UI.WebControls.TreeView
and validator controls.

j.. IF ASP.NET renders script blocks, the contents of the script blocks is
rendered in CDATA elements (inside <![CDATA[ and ]]> tags) to prevent
special characters such as & and < from being interpreted as XML.

Controlling XHTML Rendering of ASP.NET Page and Controls
Under some circumstances, you might not want ASP.NET controls to render
XHTML 1.1 markup. For example, XHTML 1.1 standards prohibit the use of a
name attribute in an HTML form tag, so ASP.NET does not render that
attribute. However, in your application, you might have existing pages with
client script that relies on the form tag's name attribute.

You can configure ASP.NET so that it does not render XHTML 1.1 markup to
allow pages created in earlier versions of ASP.NET to work as designed. For
more information, see How to: Configure ASP.NET for Non-XHTML Rendering.

"Patrice" <no****@nowhere.com> wrote in message
news:e5**************@TK2MSFTNGP14.phx.gbl...
As noted by Joerg, this is HTML not XHTML...

If it really causes a problem you could register the client script using
the
"ClientScript" member of the page class and just make the call using
Attributes.Add. Here you render the script as an HTML attribute causing
the
string to be HTML encoded (likely ASP.NET doesn't check anyhting, this is
an
HTML attribute then it encodes it)...

Let us know about your findings (especially if using HTML encoded scripts
causes a problem on some browsers)...

Patrice

--

"Alex D." <al********@hotmail.com> a écrit dans le message de
news:OJ**************@TK2MSFTNGP09.phx.gbl...
like this:

this.txtUserName.Attributes.Add("onkeydown","if((e vent.which &&

event.which
== 13)||(event.keyCode && event.keyCode ==
13)){document.Form1.cmdLogin.click();return false;}else return true;");

that code rendered javascript to the client OK. Now that I upgraded to
ASP.NET 2 Beta 2 it is rendering &amp;&amp; instead of &&, so clients are
getting this instead:

if((event.which &amp;&amp; event.which == 13)||(event.keyCode &amp;&amp;
event.keyCode == 13)){document.Form1.cmdLogin.click();return false;}else
return true;

"Patrice" <no****@nowhere.com> wrote in message
news:uL**************@TK2MSFTNGP09.phx.gbl...
> How do you render your scripts ?
>
> Patrice
>
> --
>
> "Alex D." <al********@hotmail.com> a écrit dans le message de
> news:uq**************@TK2MSFTNGP10.phx.gbl...
>> How can I stop asp.net from rendering XHTML istead of HTML?
>> My javascripts are rendering wrong because of that. It is rendering &amp; > to
>> clients instead of &.
>> Any help?
>> Thanks,
>> Alejandro.
>>
>>
>
>



Nov 19 '05 #8
whole article: http://msdn2.microsoft.com/library/e...us,vs.80).aspx
"Patrice" <no****@nowhere.com> wrote in message
news:e5**************@TK2MSFTNGP14.phx.gbl...
As noted by Joerg, this is HTML not XHTML...

If it really causes a problem you could register the client script using
the
"ClientScript" member of the page class and just make the call using
Attributes.Add. Here you render the script as an HTML attribute causing
the
string to be HTML encoded (likely ASP.NET doesn't check anyhting, this is
an
HTML attribute then it encodes it)...

Let us know about your findings (especially if using HTML encoded scripts
causes a problem on some browsers)...

Patrice

--

"Alex D." <al********@hotmail.com> a écrit dans le message de
news:OJ**************@TK2MSFTNGP09.phx.gbl...
like this:

this.txtUserName.Attributes.Add("onkeydown","if((e vent.which &&

event.which
== 13)||(event.keyCode && event.keyCode ==
13)){document.Form1.cmdLogin.click();return false;}else return true;");

that code rendered javascript to the client OK. Now that I upgraded to
ASP.NET 2 Beta 2 it is rendering &amp;&amp; instead of &&, so clients are
getting this instead:

if((event.which &amp;&amp; event.which == 13)||(event.keyCode &amp;&amp;
event.keyCode == 13)){document.Form1.cmdLogin.click();return false;}else
return true;

"Patrice" <no****@nowhere.com> wrote in message
news:uL**************@TK2MSFTNGP09.phx.gbl...
> How do you render your scripts ?
>
> Patrice
>
> --
>
> "Alex D." <al********@hotmail.com> a écrit dans le message de
> news:uq**************@TK2MSFTNGP10.phx.gbl...
>> How can I stop asp.net from rendering XHTML istead of HTML?
>> My javascripts are rendering wrong because of that. It is rendering &amp; > to
>> clients instead of &.
>> Any help?
>> Thanks,
>> Alejandro.
>>
>>
>
>



Nov 19 '05 #9
What I meant was to use Me.ClientScript.RegisterClientScriptBlock to render
the script and then use attributes.add just to call it... AFAIK scripts
registered his way are not encoded (the trick is that this function knows
this a script while attributes.add doesn't know what you are doing).

What browser are you using ? Here HTML encoded JavaScript code seems to work
fine...

Hope I'm clearer...

Patrice

--

"Alex D." <al********@hotmail.com> a écrit dans le message de
news:OO**************@TK2MSFTNGP10.phx.gbl...
my friend, I get the same problem even if I insert the code here:

<FORM id=Form1 method=post runat="server" onload=
"if((event.which && event.which== 13)||(event.keyCode && event.keyCode ==
13)){document.Form1.cmdLogin.click();return false;}else return true;");>

but if I insert the code BEFORE the FORM tag , let say, inside the BODY,
then it render & instead of &amp; which is OK. SO it is an XHTML related
problem

If you are interested you can read this, I tried the suggested solution to
disable XHTML but it didn't work.

ASP.NET and XHTML Compliance
ASP.NET allows you to create Web pages that are compliant with XHTML 1.1
standards. XHTML is a W3C standard that defines HTML as an XML document.
Creating Web pages that are conformant with XHTML standards guarantees that the elements in the pages are well formed. Because many browsers are moving toward supporting XHTML, creating pages that conform to XHTML standards
helps ensure that your pages will be compatible with browsers in the future. XHTML is also extensible, allowing the definition of new elements. Finally, an XHTML page is much easier to read programmatically for situations in
which the Web page is processed by a computer rather than read by users, and the document can be manipulated using transformations. For more information about the XHTML standard, see the W3C site at www.w3.org/TR/xhtml1.

Compliance Features
XHTML defines elements and attributes more strictly than HTML. By default,
all markup produced by ASP.NET and Web server controls included with ASP.NET now conforms to this standard.

Some of the XHTML rules that differ from HTML include the following:

a.. All elements either include an explicit closing tag or are
self-closing (with />).

b.. Tag and attribute names are rendered in lowercase, and attribute
values are included in double quotation marks. For example, if you use a
System.Web.UI.WebControls.GridView control on your page, when the page is
rendered, the System.Web.UI.WebControls.GridView control emits HTML that is XHTML compliant. All generated elements use explicit opening and closing
tags (or self-closing tags), and attribute values are included in double
quotation marks.

c.. Formatting information is rendered using only cascading style sheet
styler. To support this standard, ASP.NET controls do not render <font> tags or attributes such as bgcolor.

d.. Controls do not render custom attributes (expando attributes) that are not defined in the XHTML standards.

e.. In ASP.NET, if controls generate IDs, as occurs in the Repeater,
GridView, and other controls, the format of the IDs is XHTML 1.1 compliant.
f.. ASP.NET dynamically adds an action attribute to the form tag. Because XHTML 1.1 prohibits it, form tags do not include a name attribute.

g.. Because XHTML requires all elements to be enclosed in a container
element, ASP.NET controls such as input elements are rendered in div
elements. This includes the HTML markup rendered for controls such as the
TextBox, CheckBox, and RadioButton controls. It also includes hidden fields, such as the element used to store view-state data.

h.. ASP.NET codes characters such as & (for example, as &amp;). This
includes URLs that are generated to reference JavaScript script and the
contents of encoded values such as view state.

i.. Any script tags rendered into the page include an appropriate type
attribute. (This pertains to scripts that are created by the page or
controls or by the RegisterHiddenField, RegisterStartupScript, and
RegisterClientScriptBlock methods; script blocks that you create are not
automatically amended with a type attribute.) In ASP.NET any script tags
rendered by the page use the appropriate type attribute
(type="type/javascript") and do not include a language attribute. ASP.NET
renders script tags when the page includes certain controls (such as the
System.Web.UI.WebControls.HyperLink , System.Web.UI.WebControls.LinkButton , and System.Web.UI.WebControls.Calendar controls) that require client script to perform a postback. Script is also rendered for controls that rely on
client-side functionality, such as the System.Web.UI.WebControls.TreeView
and validator controls.

j.. IF ASP.NET renders script blocks, the contents of the script blocks is rendered in CDATA elements (inside <![CDATA[ and ]]> tags) to prevent
special characters such as & and < from being interpreted as XML.

Controlling XHTML Rendering of ASP.NET Page and Controls
Under some circumstances, you might not want ASP.NET controls to render
XHTML 1.1 markup. For example, XHTML 1.1 standards prohibit the use of a
name attribute in an HTML form tag, so ASP.NET does not render that
attribute. However, in your application, you might have existing pages with client script that relies on the form tag's name attribute.

You can configure ASP.NET so that it does not render XHTML 1.1 markup to
allow pages created in earlier versions of ASP.NET to work as designed. For more information, see How to: Configure ASP.NET for Non-XHTML Rendering.

"Patrice" <no****@nowhere.com> wrote in message
news:e5**************@TK2MSFTNGP14.phx.gbl...
As noted by Joerg, this is HTML not XHTML...

If it really causes a problem you could register the client script using
the
"ClientScript" member of the page class and just make the call using
Attributes.Add. Here you render the script as an HTML attribute causing
the
string to be HTML encoded (likely ASP.NET doesn't check anyhting, this is an
HTML attribute then it encodes it)...

Let us know about your findings (especially if using HTML encoded scripts causes a problem on some browsers)...

Patrice

--

"Alex D." <al********@hotmail.com> a écrit dans le message de
news:OJ**************@TK2MSFTNGP09.phx.gbl...
like this:

this.txtUserName.Attributes.Add("onkeydown","if((e vent.which &&

event.which
== 13)||(event.keyCode && event.keyCode ==
13)){document.Form1.cmdLogin.click();return false;}else return true;");

that code rendered javascript to the client OK. Now that I upgraded to
ASP.NET 2 Beta 2 it is rendering &amp;&amp; instead of &&, so clients are getting this instead:

if((event.which &amp;&amp; event.which == 13)||(event.keyCode &amp;&amp; event.keyCode == 13)){document.Form1.cmdLogin.click();return false;}else return true;

"Patrice" <no****@nowhere.com> wrote in message
news:uL**************@TK2MSFTNGP09.phx.gbl...
> How do you render your scripts ?
>
> Patrice
>
> --
>
> "Alex D." <al********@hotmail.com> a écrit dans le message de
> news:uq**************@TK2MSFTNGP10.phx.gbl...
>> How can I stop asp.net from rendering XHTML istead of HTML?
>> My javascripts are rendering wrong because of that. It is rendering

&amp;
> to
>> clients instead of &.
>> Any help?
>> Thanks,
>> Alejandro.
>>
>>
>
>



Nov 19 '05 #10
HTML enconded javascript woks fine here too.... what doesn't work fine is
XHTML encoded javascript....
If I use Me.ClientScript.RegisterClientScriptBlock then I guess I need to
create a whole function() and then call the function from attributes.add...
is that right?
"Patrice" <no****@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
What I meant was to use Me.ClientScript.RegisterClientScriptBlock to
render
the script and then use attributes.add just to call it... AFAIK scripts
registered his way are not encoded (the trick is that this function knows
this a script while attributes.add doesn't know what you are doing).

What browser are you using ? Here HTML encoded JavaScript code seems to
work
fine...

Hope I'm clearer...

Patrice

--

"Alex D." <al********@hotmail.com> a écrit dans le message de
news:OO**************@TK2MSFTNGP10.phx.gbl...
my friend, I get the same problem even if I insert the code here:

<FORM id=Form1 method=post runat="server" onload=
"if((event.which && event.which== 13)||(event.keyCode && event.keyCode ==
13)){document.Form1.cmdLogin.click();return false;}else return true;");>

but if I insert the code BEFORE the FORM tag , let say, inside the BODY,
then it render & instead of &amp; which is OK. SO it is an XHTML related
problem

If you are interested you can read this, I tried the suggested solution
to
disable XHTML but it didn't work.

ASP.NET and XHTML Compliance
ASP.NET allows you to create Web pages that are compliant with XHTML 1.1
standards. XHTML is a W3C standard that defines HTML as an XML document.
Creating Web pages that are conformant with XHTML standards guarantees

that
the elements in the pages are well formed. Because many browsers are

moving
toward supporting XHTML, creating pages that conform to XHTML standards
helps ensure that your pages will be compatible with browsers in the

future.
XHTML is also extensible, allowing the definition of new elements.

Finally,
an XHTML page is much easier to read programmatically for situations in
which the Web page is processed by a computer rather than read by users,

and
the document can be manipulated using transformations. For more

information
about the XHTML standard, see the W3C site at www.w3.org/TR/xhtml1.

Compliance Features
XHTML defines elements and attributes more strictly than HTML. By
default,
all markup produced by ASP.NET and Web server controls included with

ASP.NET
now conforms to this standard.

Some of the XHTML rules that differ from HTML include the following:

a.. All elements either include an explicit closing tag or are
self-closing (with />).

b.. Tag and attribute names are rendered in lowercase, and attribute
values are included in double quotation marks. For example, if you use a
System.Web.UI.WebControls.GridView control on your page, when the page is
rendered, the System.Web.UI.WebControls.GridView control emits HTML that

is
XHTML compliant. All generated elements use explicit opening and closing
tags (or self-closing tags), and attribute values are included in double
quotation marks.

c.. Formatting information is rendered using only cascading style sheet
styler. To support this standard, ASP.NET controls do not render <font>

tags
or attributes such as bgcolor.

d.. Controls do not render custom attributes (expando attributes) that

are
not defined in the XHTML standards.

e.. In ASP.NET, if controls generate IDs, as occurs in the Repeater,
GridView, and other controls, the format of the IDs is XHTML 1.1

compliant.

f.. ASP.NET dynamically adds an action attribute to the form tag.

Because
XHTML 1.1 prohibits it, form tags do not include a name attribute.

g.. Because XHTML requires all elements to be enclosed in a container
element, ASP.NET controls such as input elements are rendered in div
elements. This includes the HTML markup rendered for controls such as the
TextBox, CheckBox, and RadioButton controls. It also includes hidden

fields,
such as the element used to store view-state data.

h.. ASP.NET codes characters such as & (for example, as &amp;). This
includes URLs that are generated to reference JavaScript script and the
contents of encoded values such as view state.

i.. Any script tags rendered into the page include an appropriate type
attribute. (This pertains to scripts that are created by the page or
controls or by the RegisterHiddenField, RegisterStartupScript, and
RegisterClientScriptBlock methods; script blocks that you create are not
automatically amended with a type attribute.) In ASP.NET any script tags
rendered by the page use the appropriate type attribute
(type="type/javascript") and do not include a language attribute. ASP.NET
renders script tags when the page includes certain controls (such as the
System.Web.UI.WebControls.HyperLink ,
System.Web.UI.WebControls.LinkButton

,
and System.Web.UI.WebControls.Calendar controls) that require client

script
to perform a postback. Script is also rendered for controls that rely on
client-side functionality, such as the System.Web.UI.WebControls.TreeView
and validator controls.

j.. IF ASP.NET renders script blocks, the contents of the script blocks

is
rendered in CDATA elements (inside <![CDATA[ and ]]> tags) to prevent
special characters such as & and < from being interpreted as XML.

Controlling XHTML Rendering of ASP.NET Page and Controls
Under some circumstances, you might not want ASP.NET controls to render
XHTML 1.1 markup. For example, XHTML 1.1 standards prohibit the use of a
name attribute in an HTML form tag, so ASP.NET does not render that
attribute. However, in your application, you might have existing pages

with
client script that relies on the form tag's name attribute.

You can configure ASP.NET so that it does not render XHTML 1.1 markup to
allow pages created in earlier versions of ASP.NET to work as designed.

For
more information, see How to: Configure ASP.NET for Non-XHTML Rendering.

"Patrice" <no****@nowhere.com> wrote in message
news:e5**************@TK2MSFTNGP14.phx.gbl...
> As noted by Joerg, this is HTML not XHTML...
>
> If it really causes a problem you could register the client script
> using
> the
> "ClientScript" member of the page class and just make the call using
> Attributes.Add. Here you render the script as an HTML attribute causing
> the
> string to be HTML encoded (likely ASP.NET doesn't check anyhting, this is > an
> HTML attribute then it encodes it)...
>
> Let us know about your findings (especially if using HTML encoded scripts > causes a problem on some browsers)...
>
> Patrice
>
> --
>
> "Alex D." <al********@hotmail.com> a écrit dans le message de
> news:OJ**************@TK2MSFTNGP09.phx.gbl...
>> like this:
>>
>> this.txtUserName.Attributes.Add("onkeydown","if((e vent.which &&
> event.which
>> == 13)||(event.keyCode && event.keyCode ==
>> 13)){document.Form1.cmdLogin.click();return false;}else return
>> true;");
>>
>> that code rendered javascript to the client OK. Now that I upgraded to
>> ASP.NET 2 Beta 2 it is rendering &amp;&amp; instead of &&, so clients are >> getting this instead:
>>
>> if((event.which &amp;&amp; event.which == 13)||(event.keyCode &amp;&amp; >> event.keyCode == 13)){document.Form1.cmdLogin.click();return false;}else >> return true;
>>
>>
>>
>>
>>
>> "Patrice" <no****@nowhere.com> wrote in message
>> news:uL**************@TK2MSFTNGP09.phx.gbl...
>> > How do you render your scripts ?
>> >
>> > Patrice
>> >
>> > --
>> >
>> > "Alex D." <al********@hotmail.com> a écrit dans le message de
>> > news:uq**************@TK2MSFTNGP10.phx.gbl...
>> >> How can I stop asp.net from rendering XHTML istead of HTML?
>> >> My javascripts are rendering wrong because of that. It is rendering
> &amp;
>> > to
>> >> clients instead of &.
>> >> Any help?
>> >> Thanks,
>> >> Alejandro.
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Nov 19 '05 #11
Yes this is what I meant...

I don't see what difference you ake between "XHTML" and "HTML" encoded
scripts...

For example the problme seems to be related to & being &amp;

What if you try just :

TextBox1.Attributes.Add("onkeydown","alert(8 && 4);")

Even if it is rendered as :
onkeydown="alert(8 &amp;&amp; 4);" does it work as expected ?

Patrice
--

"Alex D." <al********@hotmail.com> a écrit dans le message de
news:OB**************@TK2MSFTNGP10.phx.gbl...
HTML enconded javascript woks fine here too.... what doesn't work fine is
XHTML encoded javascript....
If I use Me.ClientScript.RegisterClientScriptBlock then I guess I need to
create a whole function() and then call the function from attributes.add... is that right?
"Patrice" <no****@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
What I meant was to use Me.ClientScript.RegisterClientScriptBlock to
render
the script and then use attributes.add just to call it... AFAIK scripts
registered his way are not encoded (the trick is that this function knows this a script while attributes.add doesn't know what you are doing).

What browser are you using ? Here HTML encoded JavaScript code seems to
work
fine...

Hope I'm clearer...

Patrice

--

"Alex D." <al********@hotmail.com> a écrit dans le message de
news:OO**************@TK2MSFTNGP10.phx.gbl...
my friend, I get the same problem even if I insert the code here:

<FORM id=Form1 method=post runat="server" onload=
"if((event.which && event.which== 13)||(event.keyCode && event.keyCode == 13)){document.Form1.cmdLogin.click();return false;}else return true;");>
but if I insert the code BEFORE the FORM tag , let say, inside the BODY, then it render & instead of &amp; which is OK. SO it is an XHTML related problem

If you are interested you can read this, I tried the suggested solution to
disable XHTML but it didn't work.

ASP.NET and XHTML Compliance
ASP.NET allows you to create Web pages that are compliant with XHTML 1.1 standards. XHTML is a W3C standard that defines HTML as an XML document. Creating Web pages that are conformant with XHTML standards guarantees

that
the elements in the pages are well formed. Because many browsers are

moving
toward supporting XHTML, creating pages that conform to XHTML standards
helps ensure that your pages will be compatible with browsers in the

future.
XHTML is also extensible, allowing the definition of new elements.

Finally,
an XHTML page is much easier to read programmatically for situations in
which the Web page is processed by a computer rather than read by users,
and
the document can be manipulated using transformations. For more

information
about the XHTML standard, see the W3C site at www.w3.org/TR/xhtml1.

Compliance Features
XHTML defines elements and attributes more strictly than HTML. By
default,
all markup produced by ASP.NET and Web server controls included with

ASP.NET
now conforms to this standard.

Some of the XHTML rules that differ from HTML include the following:

a.. All elements either include an explicit closing tag or are
self-closing (with />).

b.. Tag and attribute names are rendered in lowercase, and attribute
values are included in double quotation marks. For example, if you use
a System.Web.UI.WebControls.GridView control on your page, when the page is rendered, the System.Web.UI.WebControls.GridView control emits HTML that is
XHTML compliant. All generated elements use explicit opening and
closing tags (or self-closing tags), and attribute values are included in double quotation marks.

c.. Formatting information is rendered using only cascading style sheet styler. To support this standard, ASP.NET controls do not render <font>

tags
or attributes such as bgcolor.

d.. Controls do not render custom attributes (expando attributes) that are
not defined in the XHTML standards.

e.. In ASP.NET, if controls generate IDs, as occurs in the Repeater,
GridView, and other controls, the format of the IDs is XHTML 1.1

compliant.

f.. ASP.NET dynamically adds an action attribute to the form tag.

Because
XHTML 1.1 prohibits it, form tags do not include a name attribute.

g.. Because XHTML requires all elements to be enclosed in a container
element, ASP.NET controls such as input elements are rendered in div
elements. This includes the HTML markup rendered for controls such as
the TextBox, CheckBox, and RadioButton controls. It also includes hidden

fields,
such as the element used to store view-state data.

h.. ASP.NET codes characters such as & (for example, as &amp;). This
includes URLs that are generated to reference JavaScript script and the
contents of encoded values such as view state.

i.. Any script tags rendered into the page include an appropriate type attribute. (This pertains to scripts that are created by the page or
controls or by the RegisterHiddenField, RegisterStartupScript, and
RegisterClientScriptBlock methods; script blocks that you create are not automatically amended with a type attribute.) In ASP.NET any script tags rendered by the page use the appropriate type attribute
(type="type/javascript") and do not include a language attribute. ASP.NET renders script tags when the page includes certain controls (such as the System.Web.UI.WebControls.HyperLink ,
System.Web.UI.WebControls.LinkButton

,
and System.Web.UI.WebControls.Calendar controls) that require client

script
to perform a postback. Script is also rendered for controls that rely on client-side functionality, such as the System.Web.UI.WebControls.TreeView and validator controls.

j.. IF ASP.NET renders script blocks, the contents of the script blocks is
rendered in CDATA elements (inside <![CDATA[ and ]]> tags) to prevent
special characters such as & and < from being interpreted as XML.

Controlling XHTML Rendering of ASP.NET Page and Controls
Under some circumstances, you might not want ASP.NET controls to render
XHTML 1.1 markup. For example, XHTML 1.1 standards prohibit the use of
a name attribute in an HTML form tag, so ASP.NET does not render that
attribute. However, in your application, you might have existing pages

with
client script that relies on the form tag's name attribute.

You can configure ASP.NET so that it does not render XHTML 1.1 markup to allow pages created in earlier versions of ASP.NET to work as designed.

For
more information, see How to: Configure ASP.NET for Non-XHTML Rendering.
"Patrice" <no****@nowhere.com> wrote in message
news:e5**************@TK2MSFTNGP14.phx.gbl...
> As noted by Joerg, this is HTML not XHTML...
>
> If it really causes a problem you could register the client script
> using
> the
> "ClientScript" member of the page class and just make the call using
> Attributes.Add. Here you render the script as an HTML attribute causing > the
> string to be HTML encoded (likely ASP.NET doesn't check anyhting, this is
> an
> HTML attribute then it encodes it)...
>
> Let us know about your findings (especially if using HTML encoded

scripts
> causes a problem on some browsers)...
>
> Patrice
>
> --
>
> "Alex D." <al********@hotmail.com> a écrit dans le message de
> news:OJ**************@TK2MSFTNGP09.phx.gbl...
>> like this:
>>
>> this.txtUserName.Attributes.Add("onkeydown","if((e vent.which &&
> event.which
>> == 13)||(event.keyCode && event.keyCode ==
>> 13)){document.Form1.cmdLogin.click();return false;}else return
>> true;");
>>
>> that code rendered javascript to the client OK. Now that I upgraded
to >> ASP.NET 2 Beta 2 it is rendering &amp;&amp; instead of &&, so clients are
>> getting this instead:
>>
>> if((event.which &amp;&amp; event.which == 13)||(event.keyCode

&amp;&amp;
>> event.keyCode == 13)){document.Form1.cmdLogin.click();return

false;}else
>> return true;
>>
>>
>>
>>
>>
>> "Patrice" <no****@nowhere.com> wrote in message
>> news:uL**************@TK2MSFTNGP09.phx.gbl...
>> > How do you render your scripts ?
>> >
>> > Patrice
>> >
>> > --
>> >
>> > "Alex D." <al********@hotmail.com> a écrit dans le message de
>> > news:uq**************@TK2MSFTNGP10.phx.gbl...
>> >> How can I stop asp.net from rendering XHTML istead of HTML?
>> >> My javascripts are rendering wrong because of that. It is

rendering > &amp;
>> > to
>> >> clients instead of &.
>> >> Any help?
>> >> Thanks,
>> >> Alejandro.
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Nov 19 '05 #12
this is the difference:
Some of the XHTML rules that differ from HTML include the following:

a.. All elements either include an explicit closing tag or are
self-closing (with />).

b.. Tag and attribute names are rendered in lowercase, and attribute
values are included in double quotation marks. For example, if you use a
System.Web.UI.WebControls.GridView control on your page, when the page is
rendered, the System.Web.UI.WebControls.GridView control emits HTML that is
XHTML compliant. All generated elements use explicit opening and closing
tags (or self-closing tags), and attribute values are included in double
quotation marks.

c.. Formatting information is rendered using only cascading style sheet
styler. To support this standard, ASP.NET controls do not render <font> tags
or attributes such as bgcolor.

d.. Controls do not render custom attributes (expando attributes) that are
not defined in the XHTML standards.

e.. In ASP.NET, if controls generate IDs, as occurs in the Repeater,
GridView, and other controls, the format of the IDs is XHTML 1.1 compliant.

f.. ASP.NET dynamically adds an action attribute to the form tag. Because
XHTML 1.1 prohibits it, form tags do not include a name attribute.

g.. Because XHTML requires all elements to be enclosed in a container
element, ASP.NET controls such as input elements are rendered in div
elements. This includes the HTML markup rendered for controls such as the
TextBox, CheckBox, and RadioButton controls. It also includes hidden fields,
such as the element used to store view-state data.

h.. ASP.NET codes characters such as & (for example, as &amp;). This
includes URLs that are generated to reference JavaScript script and the
contents of encoded values such as view state.

i.. Any script tags rendered into the page include an appropriate type
attribute. (This pertains to scripts that are created by the page or
controls or by the RegisterHiddenField, RegisterStartupScript, and
RegisterClientScriptBlock methods; script blocks that you create are not
automatically amended with a type attribute.) In ASP.NET any script tags
rendered by the page use the appropriate type attribute
(type="type/javascript") and do not include a language attribute. ASP.NET
renders script tags when the page includes certain controls (such as the
System.Web.UI.WebControls.HyperLink , System.Web.UI.WebControls.LinkButton ,
and System.Web.UI.WebControls.Calendar controls) that require client script
to perform a postback. Script is also rendered for controls that rely on
client-side functionality, such as the System.Web.UI.WebControls.TreeView
and validator controls.

j.. IF ASP.NET renders script blocks, the contents of the script blocks is
rendered in CDATA elements (inside <![CDATA[ and ]]> tags) to prevent
special characters such as & and < from being interpreted as XML.

"Patrice" <no****@nowhere.com> wrote in message
news:u9****************@tk2msftngp13.phx.gbl...
Yes this is what I meant...

I don't see what difference you ake between "XHTML" and "HTML" encoded
scripts...

For example the problme seems to be related to & being &amp;

What if you try just :

TextBox1.Attributes.Add("onkeydown","alert(8 && 4);")

Even if it is rendered as :
onkeydown="alert(8 &amp;&amp; 4);" does it work as expected ?

Patrice
--

"Alex D." <al********@hotmail.com> a écrit dans le message de
news:OB**************@TK2MSFTNGP10.phx.gbl...
HTML enconded javascript woks fine here too.... what doesn't work fine is
XHTML encoded javascript....
If I use Me.ClientScript.RegisterClientScriptBlock then I guess I need to
create a whole function() and then call the function from

attributes.add...
is that right?
"Patrice" <no****@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
> What I meant was to use Me.ClientScript.RegisterClientScriptBlock to
> render
> the script and then use attributes.add just to call it... AFAIK scripts
> registered his way are not encoded (the trick is that this function knows > this a script while attributes.add doesn't know what you are doing).
>
> What browser are you using ? Here HTML encoded JavaScript code seems to
> work
> fine...
>
> Hope I'm clearer...
>
> Patrice
>
> --
>
> "Alex D." <al********@hotmail.com> a écrit dans le message de
> news:OO**************@TK2MSFTNGP10.phx.gbl...
>> my friend, I get the same problem even if I insert the code here:
>>
>> <FORM id=Form1 method=post runat="server" onload=
>> "if((event.which && event.which== 13)||(event.keyCode && event.keyCode == >> 13)){document.Form1.cmdLogin.click();return false;}else return true;");> >>
>> but if I insert the code BEFORE the FORM tag , let say, inside the BODY, >> then it render & instead of &amp; which is OK. SO it is an XHTML related >> problem
>>
>> If you are interested you can read this, I tried the suggested
>> solution >> to
>> disable XHTML but it didn't work.
>>
>> ASP.NET and XHTML Compliance
>> ASP.NET allows you to create Web pages that are compliant with XHTML 1.1 >> standards. XHTML is a W3C standard that defines HTML as an XML document. >> Creating Web pages that are conformant with XHTML standards guarantees
> that
>> the elements in the pages are well formed. Because many browsers are
> moving
>> toward supporting XHTML, creating pages that conform to XHTML
>> standards
>> helps ensure that your pages will be compatible with browsers in the
> future.
>> XHTML is also extensible, allowing the definition of new elements.
> Finally,
>> an XHTML page is much easier to read programmatically for situations
>> in
>> which the Web page is processed by a computer rather than read by users, > and
>> the document can be manipulated using transformations. For more
> information
>> about the XHTML standard, see the W3C site at www.w3.org/TR/xhtml1.
>>
>> Compliance Features
>> XHTML defines elements and attributes more strictly than HTML. By
>> default,
>> all markup produced by ASP.NET and Web server controls included with
> ASP.NET
>> now conforms to this standard.
>>
>> Some of the XHTML rules that differ from HTML include the following:
>>
>> a.. All elements either include an explicit closing tag or are
>> self-closing (with />).
>>
>> b.. Tag and attribute names are rendered in lowercase, and attribute
>> values are included in double quotation marks. For example, if you use a >> System.Web.UI.WebControls.GridView control on your page, when the page is >> rendered, the System.Web.UI.WebControls.GridView control emits HTML that > is
>> XHTML compliant. All generated elements use explicit opening and closing >> tags (or self-closing tags), and attribute values are included in double >> quotation marks.
>>
>> c.. Formatting information is rendered using only cascading style sheet >> styler. To support this standard, ASP.NET controls do not render
>> <font>
> tags
>> or attributes such as bgcolor.
>>
>> d.. Controls do not render custom attributes (expando attributes) that > are
>> not defined in the XHTML standards.
>>
>> e.. In ASP.NET, if controls generate IDs, as occurs in the Repeater,
>> GridView, and other controls, the format of the IDs is XHTML 1.1
> compliant.
>>
>> f.. ASP.NET dynamically adds an action attribute to the form tag.
> Because
>> XHTML 1.1 prohibits it, form tags do not include a name attribute.
>>
>> g.. Because XHTML requires all elements to be enclosed in a
>> container
>> element, ASP.NET controls such as input elements are rendered in div
>> elements. This includes the HTML markup rendered for controls such as the >> TextBox, CheckBox, and RadioButton controls. It also includes hidden
> fields,
>> such as the element used to store view-state data.
>>
>> h.. ASP.NET codes characters such as & (for example, as &amp;). This
>> includes URLs that are generated to reference JavaScript script and
>> the
>> contents of encoded values such as view state.
>>
>> i.. Any script tags rendered into the page include an appropriate type >> attribute. (This pertains to scripts that are created by the page or
>> controls or by the RegisterHiddenField, RegisterStartupScript, and
>> RegisterClientScriptBlock methods; script blocks that you create are not >> automatically amended with a type attribute.) In ASP.NET any script tags >> rendered by the page use the appropriate type attribute
>> (type="type/javascript") and do not include a language attribute. ASP.NET >> renders script tags when the page includes certain controls (such as the >> System.Web.UI.WebControls.HyperLink ,
>> System.Web.UI.WebControls.LinkButton
> ,
>> and System.Web.UI.WebControls.Calendar controls) that require client
> script
>> to perform a postback. Script is also rendered for controls that rely on >> client-side functionality, such as the System.Web.UI.WebControls.TreeView >> and validator controls.
>>
>> j.. IF ASP.NET renders script blocks, the contents of the script blocks > is
>> rendered in CDATA elements (inside <![CDATA[ and ]]> tags) to prevent
>> special characters such as & and < from being interpreted as XML.
>>
>> Controlling XHTML Rendering of ASP.NET Page and Controls
>> Under some circumstances, you might not want ASP.NET controls to
>> render
>> XHTML 1.1 markup. For example, XHTML 1.1 standards prohibit the use of a >> name attribute in an HTML form tag, so ASP.NET does not render that
>> attribute. However, in your application, you might have existing pages
> with
>> client script that relies on the form tag's name attribute.
>>
>> You can configure ASP.NET so that it does not render XHTML 1.1 markup to >> allow pages created in earlier versions of ASP.NET to work as
>> designed.
> For
>> more information, see How to: Configure ASP.NET for Non-XHTML Rendering. >>
>>
>>
>> "Patrice" <no****@nowhere.com> wrote in message
>> news:e5**************@TK2MSFTNGP14.phx.gbl...
>> > As noted by Joerg, this is HTML not XHTML...
>> >
>> > If it really causes a problem you could register the client script
>> > using
>> > the
>> > "ClientScript" member of the page class and just make the call using
>> > Attributes.Add. Here you render the script as an HTML attribute causing >> > the
>> > string to be HTML encoded (likely ASP.NET doesn't check anyhting, this > is
>> > an
>> > HTML attribute then it encodes it)...
>> >
>> > Let us know about your findings (especially if using HTML encoded
> scripts
>> > causes a problem on some browsers)...
>> >
>> > Patrice
>> >
>> > --
>> >
>> > "Alex D." <al********@hotmail.com> a écrit dans le message de
>> > news:OJ**************@TK2MSFTNGP09.phx.gbl...
>> >> like this:
>> >>
>> >> this.txtUserName.Attributes.Add("onkeydown","if((e vent.which &&
>> > event.which
>> >> == 13)||(event.keyCode && event.keyCode ==
>> >> 13)){document.Form1.cmdLogin.click();return false;}else return
>> >> true;");
>> >>
>> >> that code rendered javascript to the client OK. Now that I upgraded to >> >> ASP.NET 2 Beta 2 it is rendering &amp;&amp; instead of &&, so clients > are
>> >> getting this instead:
>> >>
>> >> if((event.which &amp;&amp; event.which == 13)||(event.keyCode
> &amp;&amp;
>> >> event.keyCode == 13)){document.Form1.cmdLogin.click();return
> false;}else
>> >> return true;
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> "Patrice" <no****@nowhere.com> wrote in message
>> >> news:uL**************@TK2MSFTNGP09.phx.gbl...
>> >> > How do you render your scripts ?
>> >> >
>> >> > Patrice
>> >> >
>> >> > --
>> >> >
>> >> > "Alex D." <al********@hotmail.com> a écrit dans le message de
>> >> > news:uq**************@TK2MSFTNGP10.phx.gbl...
>> >> >> How can I stop asp.net from rendering XHTML istead of HTML?
>> >> >> My javascripts are rendering wrong because of that. It is rendering >> > &amp;
>> >> > to
>> >> >> clients instead of &.
>> >> >> Any help?
>> >> >> Thanks,
>> >> >> Alejandro.
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
>>
>
>



Nov 19 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Peter Rohleder | last post by:
Hi, I have a few simple questions in order to use modularized xhtml and getting it to work. A simple example may make this obviouse: Lets say we want to create a simple xml-file to reflect...
59
by: Philipp Lenssen | last post by:
I've tested some of the new Nokia 6600 functionality. It ships with WAP2 and XHTML Support (it says). What it does is check the Doctype -- if it's not the XHTML Mobile Profile Doctype, but a...
32
by: jp29 | last post by:
My take on problems composing, serving and rendering XHTML documents/web pages: 1. Typical conscientious web authors are producing XHTML documents (Web pages) that feature valid Markup and with...
16
by: Mcginkel | last post by:
I am trying to find a way to load XHTML content in an Iframe. I use to do this in html by using the following code : var iframeObject = document.createElement("iframe");...
82
by: Buford Early | last post by:
I read this in http://annevankesteren.nl/2004/12/xhtml-notes "A common misconception is that XHTML 1.1 is the latest version of the XHTML series. And although it was released a bit more than a...
2
by: Joris Janssens | last post by:
I'm trying to write a program for validating XHTML 1.1-documents against the XHTML 1.1 DTD (which is actually the same as validating an XML-file) but I always get a "(404) Not found" error. This...
11
by: Tomek Toczyski | last post by:
What is the best way to attach a caption to an image in xhtml? I can attach a caption to a table by a "<caption>" tag but I would like to do sth similar to an image. How to do it in a natural...
11
by: Michael Powe | last post by:
How can I make an XHTML-compliant form of an expression in this format: document.write("<scr"+"ipt type='text/javascript' src='path/to/file.js'>"+"</scr"+"ipt>"); this turns out to be a...
10
by: Robert Huff | last post by:
Can someone offer suggestions why, on the same server (Apache 2.2.8), this works <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html lang="en-US"> <head> <link rel=stylesheet...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.