PC Review


Reply
Thread Tools Rate Thread

javascript only when not postback

 
 
Tom Edelbrok
Guest
Posts: n/a
 
      20th Apr 2006
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


 
Reply With Quote
 
 
 
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      20th Apr 2006
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" <(E-Mail Removed)> schreef in bericht
news:yJQ1g.3404$fL.1128@edtnps90...
>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
>
>



 
Reply With Quote
 
 
 
 
Tom Edelbrok
Guest
Posts: n/a
 
      20th Apr 2006
Works great! Thanks very much.

Tom




"Cor Ligthert [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> schreef in bericht
> news:yJQ1g.3404$fL.1128@edtnps90...
>>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
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where is the javascript that disables postback the postback control? gnewsgroup Microsoft ASP .NET 1 13th Feb 2008 11:45 PM
ShowDialogModal postback on close (this is not related to multiple dialogs opening upon postback) Jacky Chau Microsoft ASP .NET 2 8th Jun 2005 06:49 PM
Can I raise a postback ? Session variable only visible after postback. Please help gce Microsoft ASP .NET 2 8th May 2005 06:55 AM
Postback not being set to True on first postback =?Utf-8?B?Q2hhZA==?= Microsoft ASP .NET 2 4th Apr 2005 07:17 PM
button to only execute javascript and not postback (using code behind) Marcel Balcarek Microsoft ASP .NET 4 5th Dec 2003 07:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:09 AM.