Results 1 to 4 of 4

Thread: IsPostBack problem (solved)

  1. #1

    Thread Starter
    Addicted Member nickname's Avatar
    Join Date
    Sep 2004
    Location
    Europe - Belgium
    Posts
    170

    Resolved IsPostBack problem (solved)

    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):

    Code:
    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
    Last edited by nickname; May 23rd, 2005 at 01:57 AM.
    Software Engineer
    DBA
    Webdesigner
    --
    to code or to be coded, that's the question

  2. #2
    New Member
    Join Date
    May 2005
    Location
    UK
    Posts
    5

    Re: IsPostBack problem

    Hi nickname,

    What you need is

    VB Code:
    1. If Not IsPostBack

  3. #3
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Re: IsPostBack problem

    VB Code:
    1. If Page.IsPostBack = False
    and
    VB Code:
    1. 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)

  4. #4

    Thread Starter
    Addicted Member nickname's Avatar
    Join Date
    Sep 2004
    Location
    Europe - Belgium
    Posts
    170

    Re: IsPostBack problem

    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
    Software Engineer
    DBA
    Webdesigner
    --
    to code or to be coded, that's the question

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width