PDA

Click to See Complete Forum and Search --> : IsPostBack problem (solved)


nickname
May 18th, 2005, 08:57 AM
Hello..

asked this question in a few other threads, but to be sure, I created a new thread..

I'm using following code to run only once (when page is opened):


Protected Sub Page_Load.....

If Page.IsPostBack = False Then

Me.txtTest.Visible = True
Me.txtTest.Text = "test"

End If

End Sub


The proplem is that when the page opens, it wont work.. Only when I press a button, and it opens the window for the second time, it will work..

Someone a solution fot this problem? I hope so..

tnx in advance!

nickname

mikeyb
May 20th, 2005, 09:59 AM
Hi nickname,

What you need is

If Not IsPostBack

nemaroller
May 20th, 2005, 12:43 PM
If Page.IsPostBack = False

and

If Not Page.IsPostBack


are functionally equivalent. Therefore that would not be the origin of his problem. My guess is your txtTest visibility changes with the click of the button - in that you have code that explicity changes its visibility in the click event.

Post your entire page code (best to attach both the .aspx and aspx.vb files to this thread)

nickname
May 23rd, 2005, 01:56 AM
First I want to thank y'all for helping me out..

Second, I explain how I got my solution:

I closed my visual studio (editor) en re-opened it.. The code that originally didn't work was suddenly working.. very strange..

Probably some bug, because I'm programming in VS.net Beta 2..

PS: I used "If Page.IsPostBack = False Then"

thanks

nickname