Forum Moderators: open

Message Too Old, No Replies

Quck Simple Javascript question - syntax for If Postback = True

I want to make a DIV visible only on postback

         

letsgetsilly

4:22 pm on Jul 6, 2006 (gmt 0)

10+ Year Member



I would like to make a little javascript the header of my aspx file to read something like:

If Page.IsPostBack Then
divHome ...style.visibility:visible...
EndIf

I can make a div disappear, but I don't know the syntax in javascript to do an if postback statement.

Thanks for any help!

RonPK

8:15 pm on Jul 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



JavaScript is usually executed in the browser, or in other words client side. On the client side, there is no such thing as postback.

Or are you using JavaScript as a .net programming language?

letsgetsilly

8:22 pm on Jul 6, 2006 (gmt 0)

10+ Year Member



My objective was to un-hide a <div> after the user clicks on the same page.

I am programming in the .NET environment but I am trying to use Javscript to do the work for this task in my aspx page.

You are right with the javascript postback problem, it doesn't exist. I dont think I can make it work without submitting a form, or something similar.

Thanks for your help

rocknbil

8:54 pm on Jul 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Umm . . . set a Javascript cookie. If the cookie exists, act on it. :-)