How do I stop this javascript from being emitted?

P

Paul

Hi all,

I have a fairly basic page with some text boxes, validators and submit
buttons. I have "EnableClientScript" set to false for all the
validators and "enableEventValidation" set to false in the pages
section of the web.config file. Whenever a validator is present on the
page, the following javascript is emitted:

<script type="text/javascript">
<!--
var theForm = document.forms['aspnetForm'];
if (!theForm) {
theForm = document.aspnetForm;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
// -->
</script>

<script
src="/WebResource.axd?d=yCWeX6Nxz-J5KFaiENoCPA2&amp;t=632938428474843750"
type="text/javascript"></script>

If I remove the validators, it's not emitted. I've decoded the
viewstate and it contains the following items:

-1017253366d
__ControlsRequirePostBackKey__
ctl00$cphPage$ctl01
ctl00$cphPage$ctl02R

Does anyone know what I can do to stop the javascript being emitted?

Thanks,

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top