Entire page do postback wehn swapping image, problem

Discussion in 'ASP .Net' started by Jeff, Apr 19, 2009.

  1. Jeff

    Jeff Guest

    hi

    asp.net 2.0

    I have a Image control on my Default.aspx page, under the image control
    there are 2 buttonlinks (previous, next), so when clicking on those 2
    buttons the image control displays another picture..

    the problem is that when I do this image swap the entire page is
    refreshed/updated... instead I want only the image to refresh..

    how I do that? Need I upgrade to asp.net 3.5 and utilize UpdatePanel or is
    there some tricks in asp.net 2.0 I can use?

    any ideas?
    Jeff, Apr 19, 2009
    #1
    1. Advertising

  2. Jeff

    Chris Taylor Guest

    Hi,

    You can use the ASP.NET Ajax extensions for 2.0, which can be downloaded at
    http://www.microsoft.com/downloads/...fa-e8c9-42e3-aa19-08e2c027f5d6&displaylang=en

    Hope that helps

    --
    Chris Taylor
    http://taylorza.blogspot.com
    http://dotnetjunkies.com/weblog/chris.taylor



    "Jeff" <> wrote in message
    news:...
    > hi
    >
    > asp.net 2.0
    >
    > I have a Image control on my Default.aspx page, under the image control
    > there are 2 buttonlinks (previous, next), so when clicking on those 2
    > buttons the image control displays another picture..
    >
    > the problem is that when I do this image swap the entire page is
    > refreshed/updated... instead I want only the image to refresh..
    >
    > how I do that? Need I upgrade to asp.net 3.5 and utilize UpdatePanel or is
    > there some tricks in asp.net 2.0 I can use?
    >
    > any ideas?
    >
    Chris Taylor, Apr 19, 2009
    #2
    1. Advertising

  3. Hello Jeff,

    > hi
    >
    > asp.net 2.0
    >
    > I have a Image control on my Default.aspx page, under the image
    > control there are 2 buttonlinks (previous, next), so when clicking on
    > those 2 buttons the image control displays another picture..
    >
    > the problem is that when I do this image swap the entire page is
    > refreshed/updated... instead I want only the image to refresh..
    >
    > how I do that? Need I upgrade to asp.net 3.5 and utilize UpdatePanel
    > or is there some tricks in asp.net 2.0 I can use?
    >
    > any ideas?


    I used to write that in Javascript back in 1998 withou any problems. You
    can also do it with AJAX and UpdatePanels, but there really is no need.

    A sample can be found here:
    http://www.devx.com/tips/Tip/13653

    You just need to set the src of the image to a new URL. So if you know the
    url, or can place a list of urls in a javascript array, you can do this without
    ever needing to post back at all.

    --
    Jesse Houwing
    jesse.houwing at sogeti.nl
    Jesse Houwing, Apr 19, 2009
    #3
    1. Advertising

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. Peter Jaffe
    Replies:
    0
    Views:
    1,186
    Peter Jaffe
    Feb 4, 2004
  2. Guadala Harry

    Swapping Image Url

    Guadala Harry, Aug 13, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    5,641
    Toby Mathews
    Aug 13, 2004
  3. Richard

    image swapping problem

    Richard, Sep 6, 2003, in forum: HTML
    Replies:
    1
    Views:
    349
    Richard
    Sep 6, 2003
  4. Jeff
    Replies:
    2
    Views:
    1,390
    William Niver
    Apr 29, 2009
  5. Hubbers
    Replies:
    0
    Views:
    110
    Hubbers
    Jun 1, 2006
Loading...

Share This Page