Issue:How to update Server Control(TextBox) from a thread running in code behind in vb.net.

Discussion in 'ASP .Net' started by Jitendra Singh via .NET 247, Mar 30, 2005.

  1. If I start a thread in code behind and that thread, after the page got loaded, want to update the value in TextBox(Server control or HTML control). It gives no error but value is not shown on the page. Pls Give the solution If 1 know....Thanks...

    --------------------------------
    From: Jitendra Singh

    -----------------------
    Posted by a user from .NET 247 (http://www.dotnet247.com/)

    <Id>qcpQlcEjY0+6brxCZ0ZoNA==</Id>
     
    Jitendra Singh via .NET 247, Mar 30, 2005
    #1
    1. Advertisements

  2. Jitendra Singh via .NET 247

    Brock Allen Guest

    Starting a new Thread causes two paths of execution. The first path which
    was the Request into your webserver completes the request and thus it's long
    gone by the time your second thread tries to update a TextBox on the page.
    You're starting to play with fire, so be careful until you've spent a lot
    of time testing and understanding what you're doing.

    There's a good article by Fritz that discusses how to create asychronous
    pages which might help get you going down the right track:

    http://msdn.microsoft.com/msdnmag/issues/03/06/Threading/default.aspx

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > If I start a thread in code behind and that thread, after the page got
    > loaded, want to update the value in TextBox(Server control or HTML
    > control). It gives no error but value is not shown on the page. Pls
    > Give the solution If 1 know....Thanks...
    >
    > --------------------------------
    > From: Jitendra Singh
    > -----------------------
    > Posted by a user from .NET 247 (http://www.dotnet247.com/)
    > <Id>qcpQlcEjY0+6brxCZ0ZoNA==</Id>
    >
     
    Brock Allen, Mar 30, 2005
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Miller [msft]

    Re: Code Behind vs. no code behind: error

    Ben Miller [msft], Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    843
    Alphonse Giambrone
    Jun 28, 2003
  2. DevilZAngel
    Replies:
    3
    Views:
    8,022
    tatygonq
    Sep 20, 2006
  3. Chris
    Replies:
    4
    Views:
    534
    Michael Ramey
    Jan 30, 2004
  4. =?Utf-8?B?Um9iZXJ0?=

    Update server side asp variable in page behind code

    =?Utf-8?B?Um9iZXJ0?=, Feb 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    380
    Kevin Spencer
    Feb 4, 2004
  5. John

    Non-code behind to code behind

    John, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    732
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 19, 2007
  6. Steve Mauldin
    Replies:
    3
    Views:
    533
    Steve Mauldin
    Aug 11, 2004
  7. Mike
    Replies:
    1
    Views:
    403
    Alessandro Zifiglio
    Jan 23, 2004
  8. Pete Mahoney

    ASP.Net Server Control (Web Custom Control) Code Update Problem

    Pete Mahoney, Sep 1, 2004, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    261
Loading...