Hi,
I've been trying to get a ASP.NET site I'm working on validated as HTML 4.01
Transitional but I've run into a couple of problems - actually the only ones
left before the page is validated...
1: the ID tags on serverside controls start with a char which is not allowed
(in this case '_'), example is a Label:
<span id="_ctl0_labDate">
2: postback buttons (inputs with type submit) gets a language parameter
defined which is not allowed in transitional:
<input name="_ctl0:btnAddPreDefined" value="Lägg till" onclick="if
(typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); "
language="javascript" id="_ctl0_btnAddPreDefined" type="submit"> 15 1070
Forgot the question :)
Anyone know how to fix the problems I described?
Thanks in advance
// Fredrik
"Fredrik Elestedt" <no****@nospam.now> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... Hi,
I've been trying to get a ASP.NET site I'm working on validated as HTML 4.01 Transitional but I've run into a couple of problems - actually the only ones left before the page is validated...
1: the ID tags on serverside controls start with a char which is not allowed (in this case '_'), example is a Label: <span id="_ctl0_labDate">
2: postback buttons (inputs with type submit) gets a language parameter defined which is not allowed in transitional: <input name="_ctl0:btnAddPreDefined" value="Lägg till" onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); " language="javascript" id="_ctl0_btnAddPreDefined" type="submit">
> I've been trying to get a ASP.NET site I'm working on validated as HTML
4.01
Why?
Do your pages behave the way you would like them to in the browsers you
tested?
If so, what's the problem? If not, why don't you fix them?
Bob Lehmann
"Fredrik Elestedt" <no****@nospam.now> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... Hi,
I've been trying to get a ASP.NET site I'm working on validated as HTML
4.01 Transitional but I've run into a couple of problems - actually the only
ones left before the page is validated...
1: the ID tags on serverside controls start with a char which is not
allowed (in this case '_'), example is a Label: <span id="_ctl0_labDate">
2: postback buttons (inputs with type submit) gets a language parameter defined which is not allowed in transitional: <input name="_ctl0:btnAddPreDefined" value="Lägg till" onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); " language="javascript" id="_ctl0_btnAddPreDefined" type="submit">
Hello Fredrik, 1: the ID tags on serverside controls start with a char which is not allowed (in this case '_'), example is a Label: <span id="_ctl0_labDate">
You can avoid this by giving the containing control an ID instead of omitting it.
<form runat="server"/>
<asp:Label ID="labDate" Runat="server"/>
</form>
Generates what you are seeing - instead try:
<form ID="myForm" runat="server"/>
<asp:Label ID="labDate" Runat="server"/>
</form>
this generates "myForm_labDate" as an ID for the label.
2: postback buttons (inputs with type submit) gets a language parameter defined which is not allowed in transitional: <input name="_ctl0:btnAddPreDefined" value="Lägg till" onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); " language="javascript" id="_ctl0_btnAddPreDefined" type="submit">
I have never noticed this? But a solution could be to apply a page filter to your page, that post-processes the output to ensure validity. It's not the prettiest solution, but for .NET 1.1 I think it is the best. A good article on the subject, albeit XHTML output: http://www.aspnetresources.com/artic...tpFilters.aspx
They behave as I want - but only because the browsers tested doesn't follow
the W3C standard ti the letter...
I don't know how to fix it since the names are genereated by ASP.NET
// Fredrik
"Bob Lehmann" <no****@dontbotherme.zzz> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... I've been trying to get a ASP.NET site I'm working on validated as HTML 4.01 Why?
Do your pages behave the way you would like them to in the browsers you tested?
If so, what's the problem? If not, why don't you fix them?
Bob Lehmann
"Fredrik Elestedt" <no****@nospam.now> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... Hi,
I've been trying to get a ASP.NET site I'm working on validated as HTML 4.01 Transitional but I've run into a couple of problems - actually the only ones left before the page is validated...
1: the ID tags on serverside controls start with a char which is not allowed (in this case '_'), example is a Label: <span id="_ctl0_labDate">
2: postback buttons (inputs with type submit) gets a language parameter defined which is not allowed in transitional: <input name="_ctl0:btnAddPreDefined" value="Lägg till" onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); " language="javascript" id="_ctl0_btnAddPreDefined" type="submit">
Thanks for the reply,
I have an ID on the form though - but .NET still sets it to __aspNetForm
Don't know how to override this...
// Fredrik
"Micael Baerens" <re**********************@gmail.com> wrote in message
news:en**************@TK2MSFTNGP09.phx.gbl... Hello Fredrik,
1: the ID tags on serverside controls start with a char which is not allowed (in this case '_'), example is a Label: <span id="_ctl0_labDate">
You can avoid this by giving the containing control an ID instead of omitting it.
<form runat="server"/> <asp:Label ID="labDate" Runat="server"/> </form>
Generates what you are seeing - instead try:
<form ID="myForm" runat="server"/> <asp:Label ID="labDate" Runat="server"/> </form>
this generates "myForm_labDate" as an ID for the label.
2: postback buttons (inputs with type submit) gets a language parameter defined which is not allowed in transitional: <input name="_ctl0:btnAddPreDefined" value="Lägg till" onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); " language="javascript" id="_ctl0_btnAddPreDefined" type="submit">
I have never noticed this? But a solution could be to apply a page filter to your page, that post-processes the output to ensure validity. It's not the prettiest solution, but for .NET 1.1 I think it is the best. A good article on the subject, albeit XHTML output: http://www.aspnetresources.com/artic...tpFilters.aspx
Hello Fredrik, I have an ID on the form though - but .NET still sets it to __aspNetForm Don't know how to override this...
This seems very wierd - what version of .NET are you using?
When I use the following on .NET 1.1:
<html>
<head>
<title>X</title>
</head>
<body>
<form id="myForm" method="post" runat="server">
<asp:Label ID="labDate" Runat="server"/>
</form>
</body>
</html>
I get the following output:
<html>
<head>
<title>X</title>
</head>
<body>
<form method="post" action="X.aspx" id="myForm">
<div><input type="hidden" name="__VIEWSTATE" value="dDw5MjMzODA0MjI7Oz4c0eeC9LGZJ2oNUcAEtyn4P0c 3nQ==" /></div>
<span id="labDate"></span>
</form>
</body>
</html>
(the control isn't actually prefixed by myForm as I wrote earlier).
Kind Regards,
Micael Baerens (re**********************@gmail.com)
I have .NET 1.1 SP1 running on Win2k3
That is what my page looks like - except that there are alot more
components...
I found what causes that error - I'm using a template system...
For some reason it overrides the ID on the form to
__aspnetFormwould be nice to fix this - tried setting it programmatically,
no difference.// Fredrik
"Micael Baerens" <re**********************@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl... Hello Fredrik,
I have an ID on the form though - but .NET still sets it to __aspNetForm Don't know how to override this...
This seems very wierd - what version of .NET are you using?
When I use the following on .NET 1.1:
<html> <head> <title>X</title> </head> <body> <form id="myForm" method="post" runat="server"> <asp:Label ID="labDate" Runat="server"/> </form> </body> </html>
I get the following output:
<html> <head> <title>X</title> </head> <body> <form method="post" action="X.aspx" id="myForm"> <div><input type="hidden" name="__VIEWSTATE" value="dDw5MjMzODA0MjI7Oz4c0eeC9LGZJ2oNUcAEtyn4P0c 3nQ==" /></div>
<span id="labDate"></span> </form> </body> </html>
(the control isn't actually prefixed by myForm as I wrote earlier).
Kind Regards, Micael Baerens (re**********************@gmail.com)
Well,
I managed, finally, to get it to set the id on the label to testing_labDate
instead of __labDate.
In the loaded template control I added this.ID = "testing";
But the form ID is unfortunantly still __aspnetForm
Any ideas?
"Micael Baerens" <re**********************@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl... Hello Fredrik,
I have an ID on the form though - but .NET still sets it to __aspNetForm Don't know how to override this...
This seems very wierd - what version of .NET are you using?
When I use the following on .NET 1.1:
<html> <head> <title>X</title> </head> <body> <form id="myForm" method="post" runat="server"> <asp:Label ID="labDate" Runat="server"/> </form> </body> </html>
I get the following output:
<html> <head> <title>X</title> </head> <body> <form method="post" action="X.aspx" id="myForm"> <div><input type="hidden" name="__VIEWSTATE" value="dDw5MjMzODA0MjI7Oz4c0eeC9LGZJ2oNUcAEtyn4P0c 3nQ==" /></div>
<span id="labDate"></span> </form> </body> </html>
(the control isn't actually prefixed by myForm as I wrote earlier).
Kind Regards, Micael Baerens (re**********************@gmail.com)
Hello Fredrik, I managed, finally, to get it to set the id on the label to testing_labDate instead of __labDate. In the loaded template control I added this.ID = "testing"; But the form ID is unfortunantly still __aspnetForm Any ideas?
I don't know which templating solution you are using, but options might include inheriting from the template class to change the behaviour if possible, using the page filtering solution as described earlier or maybe manipulating the form to set a different ID, like:
Control control = Page.FindControl( "__aspnetForm" );
control.ID = "aspnetForm";
though this is very hacky and may cause something to stop working.
Kind Regards,
Micael Baerens (re**********************@gmail.com)
If they work, then why do you need to fix them?
Bob Lehmann
"Fredrik Elestedt" <no****@nospam.now> wrote in message
news:OF**************@tk2msftngp13.phx.gbl... They behave as I want - but only because the browsers tested doesn't
follow the W3C standard ti the letter...
I don't know how to fix it since the names are genereated by ASP.NET
// Fredrik
"Bob Lehmann" <no****@dontbotherme.zzz> wrote in message news:%2****************@tk2msftngp13.phx.gbl... I've been trying to get a ASP.NET site I'm working on validated as HTML 4.01 Why?
Do your pages behave the way you would like them to in the browsers you tested?
If so, what's the problem? If not, why don't you fix them?
Bob Lehmann
"Fredrik Elestedt" <no****@nospam.now> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... Hi,
I've been trying to get a ASP.NET site I'm working on validated as HTML 4.01 Transitional but I've run into a couple of problems - actually the only ones left before the page is validated...
1: the ID tags on serverside controls start with a char which is not allowed (in this case '_'), example is a Label: <span id="_ctl0_labDate">
2: postback buttons (inputs with type submit) gets a language parameter defined which is not allowed in transitional: <input name="_ctl0:btnAddPreDefined" value="Lägg till" onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); " language="javascript" id="_ctl0_btnAddPreDefined" type="submit">
Please tell me you're not serious. Please?
On Fri, 26 Nov 2004 06:50:23 -0700, "Bob Lehmann"
<no****@dontbotherme.zzz> wrote: If they work, then why do you need to fix them?
Bob Lehmann
"Fredrik Elestedt" <no****@nospam.now> wrote in message news:OF**************@tk2msftngp13.phx.gbl... They behave as I want - but only because the browsers tested doesn't follow the W3C standard ti the letter...
I don't know how to fix it since the names are genereated by ASP.NET
// Fredrik
"Bob Lehmann" <no****@dontbotherme.zzz> wrote in message news:%2****************@tk2msftngp13.phx.gbl... >> I've been trying to get a ASP.NET site I'm working on validated as HTML > 4.01 > Why? > > Do your pages behave the way you would like them to in the browsers you > tested? > > If so, what's the problem? If not, why don't you fix them? > > Bob Lehmann > > "Fredrik Elestedt" <no****@nospam.now> wrote in message > news:%2****************@TK2MSFTNGP10.phx.gbl... >> Hi, >> >> I've been trying to get a ASP.NET site I'm working on validated as HTML > 4.01 >> Transitional but I've run into a couple of problems - actually the only > ones >> left before the page is validated... >> >> 1: the ID tags on serverside controls start with a char which is not > allowed >> (in this case '_'), example is a Label: >> <span id="_ctl0_labDate"> >> >> 2: postback buttons (inputs with type submit) gets a language parameter >> defined which is not allowed in transitional: >> <input name="_ctl0:btnAddPreDefined" value="Lägg till" onclick="if >> (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); " >> language="javascript" id="_ctl0_btnAddPreDefined" type="submit"> >> >> > >
Yes, I am serious.
His, apparently non-valid HTML is functioning on his target platforms. What
is to be gained by making it "valid"?
Especially since, as the OP mentioned "because the browsers tested doesn't
follow W3C standard ti the letter..."
Are you suggesting that making his HTML "valid", but non-functional, would
be a step in the right direction?
Bob Lehmann
"Marc Jennings" <Ma**********@community.nospam> wrote in message
news:4q********************************@4ax.com... Please tell me you're not serious. Please?
On Fri, 26 Nov 2004 06:50:23 -0700, "Bob Lehmann" <no****@dontbotherme.zzz> wrote:
If they work, then why do you need to fix them?
Bob Lehmann
"Fredrik Elestedt" <no****@nospam.now> wrote in message news:OF**************@tk2msftngp13.phx.gbl... They behave as I want - but only because the browsers tested doesn't follow the W3C standard ti the letter...
I don't know how to fix it since the names are genereated by ASP.NET
// Fredrik
"Bob Lehmann" <no****@dontbotherme.zzz> wrote in message news:%2****************@tk2msftngp13.phx.gbl... >> I've been trying to get a ASP.NET site I'm working on validated as
HTML > 4.01 > Why? > > Do your pages behave the way you would like them to in the browsers
you > tested? > > If so, what's the problem? If not, why don't you fix them? > > Bob Lehmann > > "Fredrik Elestedt" <no****@nospam.now> wrote in message > news:%2****************@TK2MSFTNGP10.phx.gbl... >> Hi, >> >> I've been trying to get a ASP.NET site I'm working on validated as
HTML > 4.01 >> Transitional but I've run into a couple of problems - actually the
only > ones >> left before the page is validated... >> >> 1: the ID tags on serverside controls start with a char which is not > allowed >> (in this case '_'), example is a Label: >> <span id="_ctl0_labDate"> >> >> 2: postback buttons (inputs with type submit) gets a language
parameter >> defined which is not allowed in transitional: >> <input name="_ctl0:btnAddPreDefined" value="Lägg till" onclick="if >> (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); " >> language="javascript" id="_ctl0_btnAddPreDefined" type="submit"> >> >> > >
Micael,
Well, thanks anyway - guess i'll have to live with it for now...
// Fredrik
"Micael Baerens" <re**********************@gmail.com> wrote in message
news:eq**************@TK2MSFTNGP12.phx.gbl... Hello Fredrik,
I managed, finally, to get it to set the id on the label to testing_labDate instead of __labDate. In the loaded template control I added this.ID = "testing"; But the form ID is unfortunantly still __aspnetForm Any ideas?
I don't know which templating solution you are using, but options might include inheriting from the template class to change the behaviour if possible, using the page filtering solution as described earlier or maybe manipulating the form to set a different ID, like:
Control control = Page.FindControl( "__aspnetForm" ); control.ID = "aspnetForm";
though this is very hacky and may cause something to stop working.
Kind Regards, Micael Baerens (re**********************@gmail.com)
On Fri, 26 Nov 2004 13:22:32 -0700, "Bob Lehmann"
<no****@dontbotherme.zzz> wrote: Yes, I am serious.
His, apparently non-valid HTML is functioning on his target platforms. What is to be gained by making it "valid"?
Nothing more than making sure that a single set of code will work
across all platforms.
Especially since, as the OP mentioned "because the browsers tested doesn't follow W3C standard ti the letter..."
Are you suggesting that making his HTML "valid", but non-functional, would be a step in the right direction?
Not at all. I am suggesting that the code could be presented in a
single version to all browsers, and an acceptable result would be
visible to all. This is the reason we have standards. It was never
said that the proposed valid version would *not* work on the target
platform
OT, and slightly rant-like....
If vendors want to "extend" the functionailty of their product by
adding "features", that is fuine, but if these new features mean that
the rest of the standard is broken then there is something seriously
wrong. Let's look at it from another POV. Let's imagine that Outlook
was updated with a new engine that could sort email by the number of
characters in the mail body, but adding that feature meant that the
from address suddenly becomes unreadable in the interface - would that
be acceptable?
I am also in search of a solution to this problem and found a
explanation on another site. Apparently asp.net change names when th
form is placed in a user control (ascx). Place the form in a aspx-pag
instead and keep the id. If you have the possibility to do that.
don't have that possibility unfortunately....
Good luck
-
fiu
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
----------------------------------------------------------------------- This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Stefan Richter |
last post by:
Hi, after coding for days on stupid form validations -
Like:
strings (min / max length), numbers(min / max value), money(min / max
value), postcodes(min / max value), telefon numbers,
email...
|
by: wumingshi |
last post by:
Hi,
When validating an XML instance, sometimes the schema is not enough to
expression the validation rules. Additional validation rules may be
expressed in an application-specific way. For...
|
by: Tim Meagher |
last post by:
I am trying to use both validation controls and to add submit button
attributes, but when I add the button attributes, the javascript fpr the
validation controls is no longer created for the page. ...
|
by: Matt |
last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or
Client-Side form validation? Since I think each validator control can select
either 1) JavaScript based error dialog or 2)...
|
by: Stephen |
last post by:
Hi,
the validation controls dont work on Netscape or Mozilla and only on
Internet Explorer
why? How do i correct this problem?
Thanks
|
by: Ryan Ternier |
last post by:
We're running a site that has required field validation on the login page.
It works fine on our development / test machines. However, when I upload
this site to our live server i get this error.
...
|
by: Chris |
last post by:
Based upon some prevoius postings on what to do for adding a 'add' row to a
datagrid I utilize the footer to create the 'add' row. The only issue is that
I have it sharing the 'UpDate_Command' and...
|
by: David Colliver |
last post by:
Hi all,
I am having a slight problem that hopefully, someone can help me fix.
I have a form on a page. Many items on the form have validation controls
attached.
Also on this form are...
|
by: dustbort |
last post by:
I recently had a problem where my required field validator stopped working.
But, the page still posted back and tried to insert a record into the
database without performing server-side validation....
|
by: Jon Paal |
last post by:
validation doesn't fire
what's missing ?????
/////// ---- code -----///////////////////////////
Sub btnSubmit_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) 'Handles...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |