Controlling page from a Thread

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Re: Controlling page from a Thread

    Hi,

    1) Set the page to be Autorefresh (<META EQUIV="refresh" CONTENT="30"> -
    every 30 sec.)

    2) Declare session variables that will hold the finished image. Set it
    to null to test whenever the image is ready.

    3) On page load start new thread and send the Session as parameter.

    4) The thread is doing his job. When the thread finish its work, he set
    the session variable. For doing so the thread use the session that he
    got as parameter.

    5) The page will automatically recreate on the server every 30 sec.
    every call the page check the session variable if he found it with value
    the page return the image to the client.


    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!

    Natty Gur Guest

  2. Similar Questions and Discussions

    1. Controlling the page view between initialview, bookmarks and links
      I have a 300 page InDesign document with links, buttons and bookmarks. The client wants it to open at an initial view of 50%. All of the other...
    2. Is each .asp page executes under a different thread ?
      Addition to subject line: do the COM object instances created in each page belong to the same thread that the page is running in ? do it depend...
    3. Controlling Page Access in .aspx page
      I am building some .NET classes and pages that will be part of an existing classic ASP app. The ASP app uses cookies to store login information for...
    4. Thread: Control Overrides Page
      Hello I would like to be able that my control overrides the complete live circle of the page. The event is trigger by a Query string value. I...
    5. Controlling how the page opens
      Hi there, The information on the page I'm working on is contained in 10 layers. The client doesn't like how it is looking as it is loading (I...
  3. #2

    Default Re: Controlling page from a Thread

    Thanks for the inputs.

    I was able to implement your suggestions. But, I still have a problem with refreshing.

    As this is a time critical process, I cannot have a delayed refresh of my images (Initially,
    I'm just targetting local host). I need to update the image as and when the thread has a new
    processed image. Please let me know how I can achieve this. Or, is it possible at all?


    Regards,
    Udupa.


    "Natty Gur" <natty@dao2com.com> wrote in message news:ubFNUE8ODHA.1908@TK2MSFTNGP11.phx.gbl...
    Hi,

    1) Set the page to be Autorefresh (<META EQUIV="refresh" CONTENT="30"> -
    every 30 sec.)

    2) Declare session variables that will hold the finished image. Set it
    to null to test whenever the image is ready.

    3) On page load start new thread and send the Session as parameter.

    4) The thread is doing his job. When the thread finish its work, he set
    the session variable. For doing so the thread use the session that he
    got as parameter.

    5) The page will automatically recreate on the server every 30 sec.
    every call the page check the session variable if he found it with value
    the page return the image to the client.


    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!

    Sam Guest

  4. #3

    Default Re: Controlling page from a Thread

    If you need to show the Image as soon as it ready I think its better
    that you will create HttpHandler or page that will change its content
    type and send the image as binary data. On the page that display the
    image In the Image tag src attribute put the aspx page. When the html
    will be render by the browser the browser will call the page in the src
    attribute and when the aspx finished its work and send the image it will
    be seen on the browser.

    Image creation Page :

    Page_load
    Response.ContentType = "image/jepg"
    oBmp = New Bitmap(strPath)
    //process the image
    oBmp.Save(Response.OutputStream,
    System.Drawing.Imaging.ImageFormat.Jpeg)


    Page that shows the image
    <HTML>
    <image src=ImageCreation.aspx>

    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur Guest

  5. #4

    Default Re: Controlling page from a Thread

    I was thinking of a separate thread as the process has to update images at
    different stages of processing.
    As I see now, I can serialize processing within the page class. I am quite
    new to the web model, I have
    a few problems with page handling:

    Following is the desired flow:
    1. Client initiates process
    2. Server side code begins processing the image
    3. During processing, intermediate images are updated to an img control
    4. On completion, the final result is updated to a different img control

    I get bitmap data of the new image and it is being rendered by a separate
    page mapped to the image controls.
    (with "ImageUrl " of img control set to the new page's url).

    1. Is it possible to refresh this image page more than once from the server
    event?
    2. How can I render different img controls from aspx pages? Do I need to map
    different
    pages for each image control, or can I use a single page to cater to
    multiple controls?

    Please let me know how to go about it.

    Thanks,
    Udupa.



    "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
    news:uOB91A%23ODHA.1364@TK2MSFTNGP10.phx.gbl...
    > If you need to update the image as and when the thread has processed it,
    why
    > are you using a separate threrad? Just have the Page class do the
    > processing, and it will not return to the browser until the images are
    > ready.
    >
    > An alternative is to use JavaScript behaviors to contact a Web Service
    from
    > the client, and that Web Service can either return a response code
    > indicating that the images are not ready, or that they are. The JavaScript
    > can then set the "src" of the modified images to the location of the
    > modified images and change them programmatically without refreshing the
    > page. A reference for using JavaScript behaviors to interact with a Web
    > Service can be found at:
    >
    > [url]http://www.webreference.com/js/column97/2.html[/url]
    >
    > HTH,
    >
    > Kevin Spencer
    > Microsoft FrontPage MVP
    > Internet Developer
    > [url]http://www.takempis.com[/url]
    > Big things are made up of
    > lots of Little things.
    >

    Sam Guest

  6. #5

    Default Re: Controlling page from a Thread

    Right, I am doing this for rendering the image control.

    Even if the client is kept on hold while the thread is processing, is it
    possible to update the image page more than once with the response
    object? ('cause I need to update intermediate images during processing)

    Thanks.
    Udupa


    "Natty Gur" <natty@dao2com.com> wrote in message
    news:%23cZzoH9ODHA.3016@TK2MSFTNGP10.phx.gbl...
    > If you need to show the Image as soon as it ready I think its better
    > that you will create HttpHandler or page that will change its content
    > type and send the image as binary data. On the page that display the
    > image In the Image tag src attribute put the aspx page. When the html
    > will be render by the browser the browser will call the page in the src
    > attribute and when the aspx finished its work and send the image it will
    > be seen on the browser.
    >
    > Image creation Page :
    >
    > Page_load
    > Response.ContentType = "image/jepg"
    > oBmp = New Bitmap(strPath)
    > //process the image
    > oBmp.Save(Response.OutputStream,
    > System.Drawing.Imaging.ImageFormat.Jpeg)
    >
    >
    > Page that shows the image
    > <HTML>
    > <image src=ImageCreation.aspx>
    >
    > Natty Gur, CTO
    > Dao2Com Ltd.
    > 28th Baruch Hirsch st. Bnei-Brak
    > Israel , 51114
    >
    > Phone Numbers:
    > Office: +972-(0)3-5786668
    > Fax: +972-(0)3-5703475
    > Mobile: +972-(0)58-888377
    >
    > Know the overall picture
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Sam Guest

  7. #6

    Default Re: Controlling page from a Thread

    I don’t think so. You can set the page buffering to false but you cant
    sent Image and replace it in the same request. If all of your clients
    use IE I think that what Kevin suggest with web service is the best
    solution for your situation.

    Natty Gur, CTO
    Dao2Com Ltd.
    28th Baruch Hirsch st. Bnei-Brak
    Israel , 51114

    Phone Numbers:
    Office: +972-(0)3-5786668
    Fax: +972-(0)3-5703475
    Mobile: +972-(0)58-888377

    Know the overall picture


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur Guest

  8. #7

    Default Re: Controlling page from a Thread

    I'm sorry, but you lost me.

    HTH,

    Kevin Spencer
    Microsoft FrontPage MVP
    Internet Developer
    [url]http://www.takempis.com[/url]
    Big things are made up of
    lots of Little things.

    "Sam" <sam_281@hotmail.com> wrote in message
    news:ul$3ld%23ODHA.2224@TK2MSFTNGP10.phx.gbl...
    > I was thinking of a separate thread as the process has to update images at
    > different stages of processing.
    > As I see now, I can serialize processing within the page class. I am quite
    > new to the web model, I have
    > a few problems with page handling:
    >
    > Following is the desired flow:
    > 1. Client initiates process
    > 2. Server side code begins processing the image
    > 3. During processing, intermediate images are updated to an img control
    > 4. On completion, the final result is updated to a different img control
    >
    > I get bitmap data of the new image and it is being rendered by a separate
    > page mapped to the image controls.
    > (with "ImageUrl " of img control set to the new page's url).
    >
    > 1. Is it possible to refresh this image page more than once from the
    server
    > event?
    > 2. How can I render different img controls from aspx pages? Do I need to
    map
    > different
    > pages for each image control, or can I use a single page to cater to
    > multiple controls?
    >
    > Please let me know how to go about it.
    >
    > Thanks,
    > Udupa.
    >
    >
    >
    > "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
    > news:uOB91A%23ODHA.1364@TK2MSFTNGP10.phx.gbl...
    > > If you need to update the image as and when the thread has processed it,
    > why
    > > are you using a separate threrad? Just have the Page class do the
    > > processing, and it will not return to the browser until the images are
    > > ready.
    > >
    > > An alternative is to use JavaScript behaviors to contact a Web Service
    > from
    > > the client, and that Web Service can either return a response code
    > > indicating that the images are not ready, or that they are. The
    JavaScript
    > > can then set the "src" of the modified images to the location of the
    > > modified images and change them programmatically without refreshing the
    > > page. A reference for using JavaScript behaviors to interact with a Web
    > > Service can be found at:
    > >
    > > [url]http://www.webreference.com/js/column97/2.html[/url]
    > >
    > > HTH,
    > >
    > > Kevin Spencer
    > > Microsoft FrontPage MVP
    > > Internet Developer
    > > [url]http://www.takempis.com[/url]
    > > Big things are made up of
    > > lots of Little things.
    > >
    >
    >

    Kevin Spencer Guest

  9. #8

    Default Re: Controlling page from a Thread

    If I was not clear, I will try to put it simple:

    On a button click event, server side code has to update two image controls
    with a series of bitmap objects in sequence.

    As I am mapping web page (which renders image from memory) as the imageurl
    of the image control, I will have to refresh this page more than once from
    single request.

    Now, as I have two image controls having the same url for image, how can I
    distinguish between the two for updating different image to each of them?

    Sorry, if I am going out the way. But, I am trying to get as much as
    possible from this discussion.
    If it is not possible to do it in the server side code, pls let me know. I
    will try to implement your js/webservice solution.

    Thanks,
    Udupa.


    "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
    news:ut85HW$ODHA.2228@tk2msftngp13.phx.gbl...
    > I'm sorry, but you lost me.
    >
    > HTH,
    >
    > Kevin Spencer
    > Microsoft FrontPage MVP
    > Internet Developer
    > [url]http://www.takempis.com[/url]
    > Big things are made up of
    > lots of Little things.
    >
    > "Sam" <sam_281@hotmail.com> wrote in message
    > news:ul$3ld%23ODHA.2224@TK2MSFTNGP10.phx.gbl...
    > > I was thinking of a separate thread as the process has to update images
    at
    > > different stages of processing.
    > > As I see now, I can serialize processing within the page class. I am
    quite
    > > new to the web model, I have
    > > a few problems with page handling:
    > >
    > > Following is the desired flow:
    > > 1. Client initiates process
    > > 2. Server side code begins processing the image
    > > 3. During processing, intermediate images are updated to an img control
    > > 4. On completion, the final result is updated to a different img control
    > >
    > > I get bitmap data of the new image and it is being rendered by a
    separate
    > > page mapped to the image controls.
    > > (with "ImageUrl " of img control set to the new page's url).
    > >
    > > 1. Is it possible to refresh this image page more than once from the
    > server
    > > event?
    > > 2. How can I render different img controls from aspx pages? Do I need to
    > map
    > > different
    > > pages for each image control, or can I use a single page to cater to
    > > multiple controls?
    > >
    > > Please let me know how to go about it.
    > >
    > > Thanks,
    > > Udupa.
    > >
    > >
    > >
    > > "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
    > > news:uOB91A%23ODHA.1364@TK2MSFTNGP10.phx.gbl...
    > > > If you need to update the image as and when the thread has processed
    it,
    > > why
    > > > are you using a separate threrad? Just have the Page class do the
    > > > processing, and it will not return to the browser until the images are
    > > > ready.
    > > >
    > > > An alternative is to use JavaScript behaviors to contact a Web Service
    > > from
    > > > the client, and that Web Service can either return a response code
    > > > indicating that the images are not ready, or that they are. The
    > JavaScript
    > > > can then set the "src" of the modified images to the location of the
    > > > modified images and change them programmatically without refreshing
    the
    > > > page. A reference for using JavaScript behaviors to interact with a
    Web
    > > > Service can be found at:
    > > >
    > > > [url]http://www.webreference.com/js/column97/2.html[/url]
    > > >
    > > > HTH,
    > > >
    > > > Kevin Spencer
    > > > Microsoft FrontPage MVP
    > > > Internet Developer
    > > > [url]http://www.takempis.com[/url]
    > > > Big things are made up of
    > > > lots of Little things.
    > > >
    > >
    > >
    >
    >

    Sam Guest

  10. #9

    Default Re: Controlling page from a Thread

    Wait a second, Sam. If you use an ASPX page to render an image, it is NEVER
    refreshed. Instead, for each request for an image, a new instance of the
    page class is created and streams back the image requested.

    HTH,

    Kevin Spencer
    Microsoft FrontPage MVP
    Internet Developer
    [url]http://www.takempis.com[/url]
    Big things are made up of
    lots of Little things.

    "Sam" <sam_281@hotmail.com> wrote in message
    news:O5F8an$ODHA.2768@tk2msftngp13.phx.gbl...
    > If I was not clear, I will try to put it simple:
    >
    > On a button click event, server side code has to update two image controls
    > with a series of bitmap objects in sequence.
    >
    > As I am mapping web page (which renders image from memory) as the imageurl
    > of the image control, I will have to refresh this page more than once from
    > single request.
    >
    > Now, as I have two image controls having the same url for image, how can I
    > distinguish between the two for updating different image to each of them?
    >
    > Sorry, if I am going out the way. But, I am trying to get as much as
    > possible from this discussion.
    > If it is not possible to do it in the server side code, pls let me know. I
    > will try to implement your js/webservice solution.
    >
    > Thanks,
    > Udupa.
    >
    >
    > "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
    > news:ut85HW$ODHA.2228@tk2msftngp13.phx.gbl...
    > > I'm sorry, but you lost me.
    > >
    > > HTH,
    > >
    > > Kevin Spencer
    > > Microsoft FrontPage MVP
    > > Internet Developer
    > > [url]http://www.takempis.com[/url]
    > > Big things are made up of
    > > lots of Little things.
    > >
    > > "Sam" <sam_281@hotmail.com> wrote in message
    > > news:ul$3ld%23ODHA.2224@TK2MSFTNGP10.phx.gbl...
    > > > I was thinking of a separate thread as the process has to update
    images
    > at
    > > > different stages of processing.
    > > > As I see now, I can serialize processing within the page class. I am
    > quite
    > > > new to the web model, I have
    > > > a few problems with page handling:
    > > >
    > > > Following is the desired flow:
    > > > 1. Client initiates process
    > > > 2. Server side code begins processing the image
    > > > 3. During processing, intermediate images are updated to an img
    control
    > > > 4. On completion, the final result is updated to a different img
    control
    > > >
    > > > I get bitmap data of the new image and it is being rendered by a
    > separate
    > > > page mapped to the image controls.
    > > > (with "ImageUrl " of img control set to the new page's url).
    > > >
    > > > 1. Is it possible to refresh this image page more than once from the
    > > server
    > > > event?
    > > > 2. How can I render different img controls from aspx pages? Do I need
    to
    > > map
    > > > different
    > > > pages for each image control, or can I use a single page to cater to
    > > > multiple controls?
    > > >
    > > > Please let me know how to go about it.
    > > >
    > > > Thanks,
    > > > Udupa.
    > > >
    > > >
    > > >
    > > > "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
    > > > news:uOB91A%23ODHA.1364@TK2MSFTNGP10.phx.gbl...
    > > > > If you need to update the image as and when the thread has processed
    > it,
    > > > why
    > > > > are you using a separate threrad? Just have the Page class do the
    > > > > processing, and it will not return to the browser until the images
    are
    > > > > ready.
    > > > >
    > > > > An alternative is to use JavaScript behaviors to contact a Web
    Service
    > > > from
    > > > > the client, and that Web Service can either return a response code
    > > > > indicating that the images are not ready, or that they are. The
    > > JavaScript
    > > > > can then set the "src" of the modified images to the location of the
    > > > > modified images and change them programmatically without refreshing
    > the
    > > > > page. A reference for using JavaScript behaviors to interact with a
    > Web
    > > > > Service can be found at:
    > > > >
    > > > > [url]http://www.webreference.com/js/column97/2.html[/url]
    > > > >
    > > > > HTH,
    > > > >
    > > > > Kevin Spencer
    > > > > Microsoft FrontPage MVP
    > > > > Internet Developer
    > > > > [url]http://www.takempis.com[/url]
    > > > > Big things are made up of
    > > > > lots of Little things.
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Kevin Spencer Guest

  11. #10

    Default Re: Controlling page from a Thread

    Still learning!

    OK, new instance of ASPX page does streaming of image for each request.
    I think this solves my problem of updating different controls with different
    images.

    Any workaround for instantiating image page more than once for a single
    request on the main page? (I'm yet to figure out how to do it the first
    time)
    Or do I have to resort to polling from the client script?

    Thanks for the help,
    Udupa.


    "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
    news:enBVLYAPDHA.1624@tk2msftngp13.phx.gbl...
    > Wait a second, Sam. If you use an ASPX page to render an image, it is
    NEVER
    > refreshed. Instead, for each request for an image, a new instance of the
    > page class is created and streams back the image requested.
    >
    > HTH,
    >
    > Kevin Spencer
    > Microsoft FrontPage MVP
    > Internet Developer
    > [url]http://www.takempis.com[/url]
    > Big things are made up of
    > lots of Little things.
    >
    > "Sam" <sam_281@hotmail.com> wrote in message
    > news:O5F8an$ODHA.2768@tk2msftngp13.phx.gbl...
    > > If I was not clear, I will try to put it simple:
    > >
    > > On a button click event, server side code has to update two image
    controls
    > > with a series of bitmap objects in sequence.
    > >
    > > As I am mapping web page (which renders image from memory) as the
    imageurl
    > > of the image control, I will have to refresh this page more than once
    from
    > > single request.
    > >
    > > Now, as I have two image controls having the same url for image, how can
    I
    > > distinguish between the two for updating different image to each of
    them?
    > >
    > > Sorry, if I am going out the way. But, I am trying to get as much as
    > > possible from this discussion.
    > > If it is not possible to do it in the server side code, pls let me know.
    I
    > > will try to implement your js/webservice solution.
    > >
    > > Thanks,
    > > Udupa.
    > >
    > >
    > > "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
    > > news:ut85HW$ODHA.2228@tk2msftngp13.phx.gbl...
    > > > I'm sorry, but you lost me.
    > > >
    > > > HTH,
    > > >
    > > > Kevin Spencer
    > > > Microsoft FrontPage MVP
    > > > Internet Developer
    > > > [url]http://www.takempis.com[/url]
    > > > Big things are made up of
    > > > lots of Little things.
    > > >
    > > > "Sam" <sam_281@hotmail.com> wrote in message
    > > > news:ul$3ld%23ODHA.2224@TK2MSFTNGP10.phx.gbl...
    > > > > I was thinking of a separate thread as the process has to update
    > images
    > > at
    > > > > different stages of processing.
    > > > > As I see now, I can serialize processing within the page class. I am
    > > quite
    > > > > new to the web model, I have
    > > > > a few problems with page handling:
    > > > >
    > > > > Following is the desired flow:
    > > > > 1. Client initiates process
    > > > > 2. Server side code begins processing the image
    > > > > 3. During processing, intermediate images are updated to an img
    > control
    > > > > 4. On completion, the final result is updated to a different img
    > control
    > > > >
    > > > > I get bitmap data of the new image and it is being rendered by a
    > > separate
    > > > > page mapped to the image controls.
    > > > > (with "ImageUrl " of img control set to the new page's url).
    > > > >
    > > > > 1. Is it possible to refresh this image page more than once from the
    > > > server
    > > > > event?
    > > > > 2. How can I render different img controls from aspx pages? Do I
    need
    > to
    > > > map
    > > > > different
    > > > > pages for each image control, or can I use a single page to cater to
    > > > > multiple controls?
    > > > >
    > > > > Please let me know how to go about it.
    > > > >
    > > > > Thanks,
    > > > > Udupa.
    > > > >
    > > > >
    > > > >
    > > > > "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
    > > > > news:uOB91A%23ODHA.1364@TK2MSFTNGP10.phx.gbl...
    > > > > > If you need to update the image as and when the thread has
    processed
    > > it,
    > > > > why
    > > > > > are you using a separate threrad? Just have the Page class do the
    > > > > > processing, and it will not return to the browser until the images
    > are
    > > > > > ready.
    > > > > >
    > > > > > An alternative is to use JavaScript behaviors to contact a Web
    > Service
    > > > > from
    > > > > > the client, and that Web Service can either return a response code
    > > > > > indicating that the images are not ready, or that they are. The
    > > > JavaScript
    > > > > > can then set the "src" of the modified images to the location of
    the
    > > > > > modified images and change them programmatically without
    refreshing
    > > the
    > > > > > page. A reference for using JavaScript behaviors to interact with
    a
    > > Web
    > > > > > Service can be found at:
    > > > > >
    > > > > > [url]http://www.webreference.com/js/column97/2.html[/url]
    > > > > >
    > > > > > HTH,
    > > > > >
    > > > > > Kevin Spencer
    > > > > > Microsoft FrontPage MVP
    > > > > > Internet Developer
    > > > > > [url]http://www.takempis.com[/url]
    > > > > > Big things are made up of
    > > > > > lots of Little things.
    > > > > >
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Sam Guest

  12. #11

    Default Re: Controlling page from a Thread

    Why would you want to prevent more than one instance of a class from being
    used? What exactly is the issue here?

    HTH,

    Kevin Spencer
    Microsoft FrontPage MVP
    Internet Developer
    [url]http://www.takempis.com[/url]
    Big things are made up of
    lots of Little things.

    "Sam" <sam_281@hotmail.com> wrote in message
    news:OvOIFyAPDHA.1072@TK2MSFTNGP10.phx.gbl...
    > Still learning!
    >
    > OK, new instance of ASPX page does streaming of image for each request.
    > I think this solves my problem of updating different controls with
    different
    > images.
    >
    > Any workaround for instantiating image page more than once for a single
    > request on the main page? (I'm yet to figure out how to do it the first
    > time)
    > Or do I have to resort to polling from the client script?
    >
    > Thanks for the help,
    > Udupa.
    >
    >
    > "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
    > news:enBVLYAPDHA.1624@tk2msftngp13.phx.gbl...
    > > Wait a second, Sam. If you use an ASPX page to render an image, it is
    > NEVER
    > > refreshed. Instead, for each request for an image, a new instance of the
    > > page class is created and streams back the image requested.
    > >
    > > HTH,
    > >
    > > Kevin Spencer
    > > Microsoft FrontPage MVP
    > > Internet Developer
    > > [url]http://www.takempis.com[/url]
    > > Big things are made up of
    > > lots of Little things.
    > >
    > > "Sam" <sam_281@hotmail.com> wrote in message
    > > news:O5F8an$ODHA.2768@tk2msftngp13.phx.gbl...
    > > > If I was not clear, I will try to put it simple:
    > > >
    > > > On a button click event, server side code has to update two image
    > controls
    > > > with a series of bitmap objects in sequence.
    > > >
    > > > As I am mapping web page (which renders image from memory) as the
    > imageurl
    > > > of the image control, I will have to refresh this page more than once
    > from
    > > > single request.
    > > >
    > > > Now, as I have two image controls having the same url for image, how
    can
    > I
    > > > distinguish between the two for updating different image to each of
    > them?
    > > >
    > > > Sorry, if I am going out the way. But, I am trying to get as much as
    > > > possible from this discussion.
    > > > If it is not possible to do it in the server side code, pls let me
    know.
    > I
    > > > will try to implement your js/webservice solution.
    > > >
    > > > Thanks,
    > > > Udupa.
    > > >
    > > >
    > > > "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
    > > > news:ut85HW$ODHA.2228@tk2msftngp13.phx.gbl...
    > > > > I'm sorry, but you lost me.
    > > > >
    > > > > HTH,
    > > > >
    > > > > Kevin Spencer
    > > > > Microsoft FrontPage MVP
    > > > > Internet Developer
    > > > > [url]http://www.takempis.com[/url]
    > > > > Big things are made up of
    > > > > lots of Little things.
    > > > >
    > > > > "Sam" <sam_281@hotmail.com> wrote in message
    > > > > news:ul$3ld%23ODHA.2224@TK2MSFTNGP10.phx.gbl...
    > > > > > I was thinking of a separate thread as the process has to update
    > > images
    > > > at
    > > > > > different stages of processing.
    > > > > > As I see now, I can serialize processing within the page class. I
    am
    > > > quite
    > > > > > new to the web model, I have
    > > > > > a few problems with page handling:
    > > > > >
    > > > > > Following is the desired flow:
    > > > > > 1. Client initiates process
    > > > > > 2. Server side code begins processing the image
    > > > > > 3. During processing, intermediate images are updated to an img
    > > control
    > > > > > 4. On completion, the final result is updated to a different img
    > > control
    > > > > >
    > > > > > I get bitmap data of the new image and it is being rendered by a
    > > > separate
    > > > > > page mapped to the image controls.
    > > > > > (with "ImageUrl " of img control set to the new page's url).
    > > > > >
    > > > > > 1. Is it possible to refresh this image page more than once from
    the
    > > > > server
    > > > > > event?
    > > > > > 2. How can I render different img controls from aspx pages? Do I
    > need
    > > to
    > > > > map
    > > > > > different
    > > > > > pages for each image control, or can I use a single page to cater
    to
    > > > > > multiple controls?
    > > > > >
    > > > > > Please let me know how to go about it.
    > > > > >
    > > > > > Thanks,
    > > > > > Udupa.
    > > > > >
    > > > > >
    > > > > >
    > > > > > "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
    > > > > > news:uOB91A%23ODHA.1364@TK2MSFTNGP10.phx.gbl...
    > > > > > > If you need to update the image as and when the thread has
    > processed
    > > > it,
    > > > > > why
    > > > > > > are you using a separate threrad? Just have the Page class do
    the
    > > > > > > processing, and it will not return to the browser until the
    images
    > > are
    > > > > > > ready.
    > > > > > >
    > > > > > > An alternative is to use JavaScript behaviors to contact a Web
    > > Service
    > > > > > from
    > > > > > > the client, and that Web Service can either return a response
    code
    > > > > > > indicating that the images are not ready, or that they are. The
    > > > > JavaScript
    > > > > > > can then set the "src" of the modified images to the location of
    > the
    > > > > > > modified images and change them programmatically without
    > refreshing
    > > > the
    > > > > > > page. A reference for using JavaScript behaviors to interact
    with
    > a
    > > > Web
    > > > > > > Service can be found at:
    > > > > > >
    > > > > > > [url]http://www.webreference.com/js/column97/2.html[/url]
    > > > > > >
    > > > > > > HTH,
    > > > > > >
    > > > > > > Kevin Spencer
    > > > > > > Microsoft FrontPage MVP
    > > > > > > Internet Developer
    > > > > > > [url]http://www.takempis.com[/url]
    > > > > > > Big things are made up of
    > > > > > > lots of Little things.
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Kevin Spencer Guest

  13. #12

    Default Re: Controlling page from a Thread

    I'm not trying to prevent more than one class from being used. It is
    perfectly
    OK with me. But, my problem is with response object. I am still not familiar
    with the way responses are sent.

    When I have a request from a button click event, can I respond to it by
    refreshing (instantiationg) the image page more than once? If so, can you
    please
    tell me how to do it in code-behind?

    Thanks,
    Udupa.

    "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
    news:%23CleuLBPDHA.3152@TK2MSFTNGP10.phx.gbl...
    > Why would you want to prevent more than one instance of a class from being
    > used? What exactly is the issue here?
    >
    > HTH,
    >
    > Kevin Spencer
    > Microsoft FrontPage MVP
    > Internet Developer
    > [url]http://www.takempis.com[/url]
    > Big things are made up of
    > lots of Little things.
    >
    > "Sam" <sam_281@hotmail.com> wrote in message
    > news:OvOIFyAPDHA.1072@TK2MSFTNGP10.phx.gbl...
    > > Still learning!
    > >
    > > OK, new instance of ASPX page does streaming of image for each request.
    > > I think this solves my problem of updating different controls with
    > different
    > > images.
    > >
    > > Any workaround for instantiating image page more than once for a single
    > > request on the main page? (I'm yet to figure out how to do it the first
    > > time)
    > > Or do I have to resort to polling from the client script?
    > >
    > > Thanks for the help,
    > > Udupa.
    > >
    > >
    > > "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
    > > news:enBVLYAPDHA.1624@tk2msftngp13.phx.gbl...
    > > > Wait a second, Sam. If you use an ASPX page to render an image, it is
    > > NEVER
    > > > refreshed. Instead, for each request for an image, a new instance of
    the
    > > > page class is created and streams back the image requested.
    > > >
    > > > HTH,
    > > >
    > > > Kevin Spencer
    > > > Microsoft FrontPage MVP
    > > > Internet Developer
    > > > [url]http://www.takempis.com[/url]
    > > > Big things are made up of
    > > > lots of Little things.
    > > >
    > > > "Sam" <sam_281@hotmail.com> wrote in message
    > > > news:O5F8an$ODHA.2768@tk2msftngp13.phx.gbl...
    > > > > If I was not clear, I will try to put it simple:
    > > > >
    > > > > On a button click event, server side code has to update two image
    > > controls
    > > > > with a series of bitmap objects in sequence.
    > > > >
    > > > > As I am mapping web page (which renders image from memory) as the
    > > imageurl
    > > > > of the image control, I will have to refresh this page more than
    once
    > > from
    > > > > single request.
    > > > >
    > > > > Now, as I have two image controls having the same url for image, how
    > can
    > > I
    > > > > distinguish between the two for updating different image to each of
    > > them?
    > > > >
    > > > > Sorry, if I am going out the way. But, I am trying to get as much as
    > > > > possible from this discussion.
    > > > > If it is not possible to do it in the server side code, pls let me
    > know.
    > > I
    > > > > will try to implement your js/webservice solution.
    > > > >
    > > > > Thanks,
    > > > > Udupa.
    > > > >
    > > > >
    > > > > "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in message
    > > > > news:ut85HW$ODHA.2228@tk2msftngp13.phx.gbl...
    > > > > > I'm sorry, but you lost me.
    > > > > >
    > > > > > HTH,
    > > > > >
    > > > > > Kevin Spencer
    > > > > > Microsoft FrontPage MVP
    > > > > > Internet Developer
    > > > > > [url]http://www.takempis.com[/url]
    > > > > > Big things are made up of
    > > > > > lots of Little things.
    > > > > >
    > > > > > "Sam" <sam_281@hotmail.com> wrote in message
    > > > > > news:ul$3ld%23ODHA.2224@TK2MSFTNGP10.phx.gbl...
    > > > > > > I was thinking of a separate thread as the process has to update
    > > > images
    > > > > at
    > > > > > > different stages of processing.
    > > > > > > As I see now, I can serialize processing within the page class.
    I
    > am
    > > > > quite
    > > > > > > new to the web model, I have
    > > > > > > a few problems with page handling:
    > > > > > >
    > > > > > > Following is the desired flow:
    > > > > > > 1. Client initiates process
    > > > > > > 2. Server side code begins processing the image
    > > > > > > 3. During processing, intermediate images are updated to an img
    > > > control
    > > > > > > 4. On completion, the final result is updated to a different img
    > > > control
    > > > > > >
    > > > > > > I get bitmap data of the new image and it is being rendered by a
    > > > > separate
    > > > > > > page mapped to the image controls.
    > > > > > > (with "ImageUrl " of img control set to the new page's url).
    > > > > > >
    > > > > > > 1. Is it possible to refresh this image page more than once from
    > the
    > > > > > server
    > > > > > > event?
    > > > > > > 2. How can I render different img controls from aspx pages? Do I
    > > need
    > > > to
    > > > > > map
    > > > > > > different
    > > > > > > pages for each image control, or can I use a single page to
    cater
    > to
    > > > > > > multiple controls?
    > > > > > >
    > > > > > > Please let me know how to go about it.
    > > > > > >
    > > > > > > Thanks,
    > > > > > > Udupa.
    > > > > > >
    > > > > > >
    > > > > > >
    > > > > > > "Kevin Spencer" <kevin@SPAMMERSSUCKtakempis.com> wrote in
    message
    > > > > > > news:uOB91A%23ODHA.1364@TK2MSFTNGP10.phx.gbl...
    > > > > > > > If you need to update the image as and when the thread has
    > > processed
    > > > > it,
    > > > > > > why
    > > > > > > > are you using a separate threrad? Just have the Page class do
    > the
    > > > > > > > processing, and it will not return to the browser until the
    > images
    > > > are
    > > > > > > > ready.
    > > > > > > >
    > > > > > > > An alternative is to use JavaScript behaviors to contact a Web
    > > > Service
    > > > > > > from
    > > > > > > > the client, and that Web Service can either return a response
    > code
    > > > > > > > indicating that the images are not ready, or that they are.
    The
    > > > > > JavaScript
    > > > > > > > can then set the "src" of the modified images to the location
    of
    > > the
    > > > > > > > modified images and change them programmatically without
    > > refreshing
    > > > > the
    > > > > > > > page. A reference for using JavaScript behaviors to interact
    > with
    > > a
    > > > > Web
    > > > > > > > Service can be found at:
    > > > > > > >
    > > > > > > > [url]http://www.webreference.com/js/column97/2.html[/url]
    > > > > > > >
    > > > > > > > HTH,
    > > > > > > >
    > > > > > > > Kevin Spencer
    > > > > > > > Microsoft FrontPage MVP
    > > > > > > > Internet Developer
    > > > > > > > [url]http://www.takempis.com[/url]
    > > > > > > > Big things are made up of
    > > > > > > > lots of Little things.
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Sam Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139