Re: ASP.NET Internationalization bug?
- From: "Lee C." <no.spam@xxxxxxxxxxx>
- Date: Fri, 27 Jun 2008 10:37:10 -0400
Thanks, Juan.
I already added similar code to a page event in my masterpage code-beside.
elHtml.Attributes.Add("xml:lang",
Resources.GlobalLang.ContentAudienceLanguage)
To me, that is a temporary workaround. I still want to understand whether
the "eating" of the attribute I originally posted about is a bug, or if this
is actually happening for a reason.
Cordially,
Lee
"Juan T. Llibre" <nomailreplies@xxxxxxxxxxx> wrote in message
news:%23gBUqSC2IHA.4772@xxxxxxxxxxxxxxxxxxxxxxx
Hi, Lee.
re:
!> <html runat="server" xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en-US" lang="en-US" dir="ltr">
!> no xml:lang attribute is rendered to the browser!
!> Remove the runat="server", and, voila, the xml:lang attribute is
rendered.
Try this :
<html xmlns="http://www.w3.org/1999/xhtml" runat="server" id="someID">
<script runat="server">
someID.Attributes("xml:lang") = "en-US"
</script>
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Lee C." <nomail@xxxxxxxx> wrote in message
news:O%23KsAQA2IHA.4572@xxxxxxxxxxxxxxxxxxxxxxx
I think I have discovered a bug in ASP.NET, related to I18N.
In ASP.NET 3.5 I have to set runat="server" on the html element to use
explicit expressions. It appears that ASP.NET
eats the xml:lang attribute on the html element when it is set to
runat="server".
Of course I want to replace the hardcoded "en-US" values with (resource)
explicit expressions; but, for simplicity,
try this:
<html runat="server" xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en-US" lang="en-US" dir="ltr">
...And you will find that no xml:lang attribute is rendered to the
browser! Remove the runat="server", and, voila, the
xml:lang attribute is rendered. :[
...Any ideas?
Cordially,
Lee
.
- Follow-Ups:
- Re: ASP.NET Internationalization bug?
- From: Juan T. Llibre
- Re: ASP.NET Internationalization bug?
- References:
- ASP.NET Internationalization bug?
- From: Lee C.
- Re: ASP.NET Internationalization bug?
- From: Juan T. Llibre
- ASP.NET Internationalization bug?
- Prev by Date: Re: Mixed Authentication, ASP.Net 2.0, IIS 5.0
- Next by Date: Ajax UpdatePanel as Source for IFrame
- Previous by thread: Re: ASP.NET Internationalization bug?
- Next by thread: Re: ASP.NET Internationalization bug?
- Index(es):
Relevant Pages
|