Connecting Tech Pros Worldwide Help | Site Map

javascript only when not postback

Tom Edelbrok
Guest
 
Posts: n/a
#1: Apr 20 '06
I have an aspx page in Visual Studio 2005. I want to run a certain
javascript, but only if 'not postback'. ie: I only want the javascript to
run when the page loads for the very first time.

Is this possible?

Is there some way I can detect within the javascript if the page is being
loaded due to a PostBack or not?

Thanks in advance for any help,

Tom Edelbrok


Cor Ligthert [MVP]
Guest
 
Posts: n/a
#2: Apr 20 '06

re: javascript only when not postback


Tom,

Easy to do set a registerstartup in the load from your program and only in
the condition Not Ispostback

http://msdn2.microsoft.com/en-us/library/z9h4dk8y.aspx

Be aware that the 1.x version is obsolete.

I hope this helps,

Cor

"Tom Edelbrok" <anonymous@anonymous.com> schreef in bericht
news:yJQ1g.3404$fL.1128@edtnps90...[color=blue]
>I have an aspx page in Visual Studio 2005. I want to run a certain
>javascript, but only if 'not postback'. ie: I only want the javascript to
>run when the page loads for the very first time.
>
> Is this possible?
>
> Is there some way I can detect within the javascript if the page is being
> loaded due to a PostBack or not?
>
> Thanks in advance for any help,
>
> Tom Edelbrok
>
>[/color]


Tom Edelbrok
Guest
 
Posts: n/a
#3: Apr 20 '06

re: javascript only when not postback


Works great! Thanks very much.

Tom




"Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
news:ehaxYwKZGHA.5004@TK2MSFTNGP02.phx.gbl...[color=blue]
> Tom,
>
> Easy to do set a registerstartup in the load from your program and only in
> the condition Not Ispostback
>
> http://msdn2.microsoft.com/en-us/library/z9h4dk8y.aspx
>
> Be aware that the 1.x version is obsolete.
>
> I hope this helps,
>
> Cor
>
> "Tom Edelbrok" <anonymous@anonymous.com> schreef in bericht
> news:yJQ1g.3404$fL.1128@edtnps90...[color=green]
>>I have an aspx page in Visual Studio 2005. I want to run a certain
>>javascript, but only if 'not postback'. ie: I only want the javascript to
>>run when the page loads for the very first time.
>>
>> Is this possible?
>>
>> Is there some way I can detect within the javascript if the page is being
>> loaded due to a PostBack or not?
>>
>> Thanks in advance for any help,
>>
>> Tom Edelbrok
>>
>>[/color]
>
>[/color]


Closed Thread