Ask a Question related to ASP.NET Building Controls, Design and Development.
-
paul.hester@gmail.com #1
How do I stop this javascript from being emitted?
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&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
paul.hester@gmail.com Guest
-
STOP=Save The Opticles People! ... Stop Flashs flashing!
:| WHEN will they ever learn, our eyes are not to be played with. Imagin putting on a blindfold on for 1 - 24hr period & TRY to go about there... -
Audio doesn't stop with Javascript StopPlay()
We are using JavaScript Play() and StopPlay() functions to control the playback of Flash files embedded in a web page in Mozilla. We also embed the... -
Replication - ASNCMD "DBNAME" STOP does not stop Capure
I am running DB2 version 7.2, when I execute ASNCMD dbname STOP. 8 out of ten times Capture will bring itself down. I need this to work 100% of... -
Client Script emitted from a Repeater Item Control
I'm using a repeater to show the rows in a data table. I'd like the have a link button beside each row that removes the record, firing a client... -
Teemu Keiski #2
Re: How do I stop this javascript from being emitted?
I think it is the Button causing it to be registered when there are
validators in the same validation group with it.
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
[url]http://blogs.aspadvice.com/joteke[/url]
<paul.hester@gmail.com> wrote in message
news:1158275205.462089.28820@k70g2000cwa.googlegro ups.com...> 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&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
>
Teemu Keiski Guest
-
paul.hester@gmail.com #3
Re: How do I stop this javascript from being emitted?
Hi Teemu,
Thanks for getting back to me. Do you know how I can stop this from
happening?
Thanks,
Paul
Teemu Keiski wrote:> I think it is the Button causing it to be registered when there are
> validators in the same validation group with it.
>
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
> [url]http://blogs.aspadvice.com/joteke[/url]
>
> <paul.hester@gmail.com> wrote in message
> news:1158275205.462089.28820@k70g2000cwa.googlegro ups.com...> > 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&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
> >paul.hester@gmail.com Guest
-
Teemu Keiski #4
Re: How do I stop this javascript from being emitted?
Set CausesValidation="False" for the Button in the same validation group.
You just need to call Page.Validate on server manually before you can access
Page.IsValid property.
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
[url]http://blogs.aspadvice.com/joteke[/url]
<paul.hester@gmail.com> wrote in message
news:1158444860.430509.158590@i42g2000cwa.googlegr oups.com...> Hi Teemu,
>
> Thanks for getting back to me. Do you know how I can stop this from
> happening?
>
> Thanks,
>
> Paul
>
> Teemu Keiski wrote:>>> I think it is the Button causing it to be registered when there are
>> validators in the same validation group with it.
>>
>> --
>> Teemu Keiski
>> ASP.NET MVP, AspInsider
>> Finland, EU
>> [url]http://blogs.aspadvice.com/joteke[/url]
>>
>> <paul.hester@gmail.com> wrote in message
>> news:1158275205.462089.28820@k70g2000cwa.googlegro ups.com...>> > 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&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
>> >
Teemu Keiski Guest



Reply With Quote

