Results 1 to 5 of 5

Thread: [*resolved] table control doesnt save its content?

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    [*resolved] table control doesnt save its content?

    I have an empty table on a page, when the user clicks a button the table is filled with some text. I have another test button on the page which does nothing (just causes a postback). When that button is pressed everything in the table is gone... why does it happen?
    Last edited by MrPolite; Jul 9th, 2003 at 12:05 AM.
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Because you are building the contents of the table at run-time, you will need to generate the table on each postback. Move the code that gens the table outside of the IsPostback() method.

  3. #3

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Lethal
    Because you are building the contents of the table at run-time, you will need to generate the table on each postback. Move the code that gens the table outside of the IsPostback() method.
    yeah I'm actually generating it in a button_click event... I guess I'll have to put it in the page_load event
    thanks, shall work!
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  4. #4

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    ok works, just wondering if it's akward programming to do this

    VB Code:
    1. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         ' Force another btnPreview_click
    3.         If pnlPreview.Visible Then btnPreview_Click(Nothing, Nothing)
    4.     End Sub
    5.  
    6.     Private Sub btnPreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPreview.Click
    7.         pnlPreview.Visible = True
    8.  
    9.         ' Generate controls in the panel
    10.         ' ....
    11.     End Sub
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  5. #5
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Thats one way 2 do it, but I personally would move the code to a sub and call it directly, rather than raising the click event programmaticaly.

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