473,406 Members | 2,387 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,406 software developers and data experts.

HTML 4.01 and the PostBack javascript

When I try to validate my webpages on http://validator.w3.org the validation
fails because of the auto-generated postback function:

<script language="javascript">
<!--
function __doPostBack(eventTarget, eventArgument) {
var theform = document.defaultframework_Default;
theform.__EVENTTARGET.value = eventTarget;
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->
</script>

The reason for failing is that the script tag is missing the TYPE attribute.
Th script tag should be like this to be valid HTML 4.01:
<script language="javascript" type="text/Jscript">

Is there any way, any options or method for altering this SCRIPT tag?

I probably should say that I'm using .NET Framework 1.0.

Regards
Svein terje Gaup

Nov 18 '05 #1
1 1260
Well I can't say for sure, but I doubt there is an "easy" way to change
this. What you can do is override the render event for the page, and do a
find/replace to alter the javascript before it is sent to the client.

It would be something like this in your codebehind, which inherits from
System.Web.UI.Page.

Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
Dim sw As New System.IO.StringWriter
Dim localWriter As New HtmlTextWriter(sw)

MyBase.Render(localWriter)
Dim output As String = sw.ToString()

'here is where you would have to do a find/replace on the string to
edit the javascript tag
'but as an example I'll change everything to uppercase.
output = output.ToUpper()

writer.Write(output)

End Sub

--Michael
"Svein Terje Gaup" <ga****@yahoo.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
When I try to validate my webpages on http://validator.w3.org the validation fails because of the auto-generated postback function:

<script language="javascript">
<!--
function __doPostBack(eventTarget, eventArgument) {
var theform = document.defaultframework_Default;
theform.__EVENTTARGET.value = eventTarget;
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->
</script>

The reason for failing is that the script tag is missing the TYPE attribute. Th script tag should be like this to be valid HTML 4.01:
<script language="javascript" type="text/Jscript">

Is there any way, any options or method for altering this SCRIPT tag?

I probably should say that I'm using .NET Framework 1.0.

Regards
Svein terje Gaup

Nov 18 '05 #2

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

Similar topics

4
by: Chris Lane | last post by:
Hi, I have an HTML RESET button and Web Control Button that posts back to the server. Problem is the reset button doesn't work after the postback occurs. Any ideas or suggestions as to why this...
2
by: Nick Gilbert | last post by:
Hi I have a number of pages where it is valid for the user to enter HTML. On these pages, I have turned off RequestValidation ("ValidateRequest = false" in the page directive) so that the...
5
by: Psych971 | last post by:
Hi, I'm wondering how I can generate a postback using javascript on a page that does not have any controls with the auto-postback property set to true. I know I can just use the submit() function...
1
by: Marcus | last post by:
I have a problem maybe one of you could help me with. I've created a data entry screen with lots of dynamically-created client-side controls. I create HTML texboxes client-side by assigning a...
5
by: astro | last post by:
I want to have 2 mutually exclusive checkboxes on a webform. I do not want to post back to server for this to happen. Last week I built this using javascript with each ctrl calling a javascript...
2
by: jon | last post by:
Hi This might be an easy one to answer but I have a web form in an ASP.NET 1.1 application with a hand-rolled HTML image button as follows which opens a help guide in a new window: <input...
7
by: Tony Girgenti | last post by:
Hello. I'm trying to undetrstand ASP.NET 2.0 and javascript. When i have a button and i click on it and i see the web broswer progress bar at the bottom do something, does that mean that there...
8
by: =?Utf-8?B?U2hhd24gUmFtaXJleg==?= | last post by:
I am coming at the world from the standpoint of a veteran ASP Classic developer. I am not clear on the advantages of using the ASP.NET control over standard HTML control. With the ASP.NET...
4
by: Chris | last post by:
Hi, i 'm experimenting with postback and i tried that with a button server control and an Html input button but with runat="server". The button server control causes a postback, but not the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
Oralloy
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.