Loads page.aspx again in every click.

Last post 01-08-2007 2:43 AM by raikkonen. 6 replies.

Sort Posts:

  • Loads page.aspx again in every click.

    12-01-2006, 12:29 AM
    • Member
      106 point Member
    • raikkonen
    • Member since 09-29-2006, 5:43 AM
    • Posts 151

    Hi, I created a page (a unique aspx file) where I have all the controls in that page together and some of them are hidden but others are visible,according to the exact state of the page.The problem is that I do not want to load all the page again and again in every user's click,but only the parts of the page that are changed...

    Such us, I have some imagebuttons and an image control in that page and if I click to an imagebutton to show its icon to the bigger image control,then all the page loads again,with the background image and all the stuff,visible or not.

    Is there a way to avoid doing this?

    Thanks in advance...

  • Re: Loads page.aspx again in every click.

    12-01-2006, 1:25 AM
    • All-Star
      23,803 point All-Star
    • pkellner
    • Member since 11-12-2004, 10:42 AM
    • San Jose, California
    • Posts 3,567
    • Moderator
      TrustedFriends-MVPs

    In order to skip parts of your page_load from running, simply put them inside an if statement like this:

    If (!Page.IsPostback)
    {

      anything you put in here will only get executed when the first page is loaded.

      make sure you pay attention to viewstate

    }

    Peter Kellner
    http://peterkellner.net
    Microsoft MVP • ASPInsider
  • Re: Loads page.aspx again in every click.

    12-15-2006, 2:33 PM
    • Member
      106 point Member
    • raikkonen
    • Member since 09-29-2006, 5:43 AM
    • Posts 151

    Hi again,

     I did the following change but I think every stuff in page is loaded in every click....

    1    If IsPostBack = False Then
    2                Image1.ImageUrl = "images/background.gif"
    3                Image2.ImageUrl = "images/riges4.gif"
    4                Image3.ImageUrl = "images/logotipo1.gif"
    5    End If
    

     

    If you want to check nad if you've got some time...please visit www.tavlikos.gr

    Thanks....

  • Re: Loads page.aspx again in every click.

    12-22-2006, 8:02 AM
    • Member
      24 point Member
    • leiyangcl
    • Member since 09-25-2006, 9:06 AM
    • Posts 16
    Add the following attribute to the Page directive:
    AutoEventWireup="false"
  • Re: Loads page.aspx again in every click.

    12-23-2006, 3:58 AM
    • Member
      106 point Member
    • raikkonen
    • Member since 09-29-2006, 5:43 AM
    • Posts 151

    It is still the same behaviour....anyway thanks for the answer...

  • Re: Loads page.aspx again in every click.

    12-26-2006, 12:11 AM
    • Member
      6 point Member
    • sofen
    • Member since 10-04-2006, 8:16 AM
    • Posts 3

    it is improssible  for u to don't reload all the page  except using  Ajax technology 

    when u click a button in client browser  ,it will take  a request to the server ,and the server will give a response to u ,and at this time it will reload all the controls in you page .

     at last, i am sorry for my poor english.

  • Re: Loads page.aspx again in every click.

    01-08-2007, 2:43 AM
    • Member
      106 point Member
    • raikkonen
    • Member since 09-29-2006, 5:43 AM
    • Posts 151

    1)Ok.I understood....but if I use Ajax technology,I think that all the site will become heavier,right?

    2)How can I use this technology?

    Thanks for your precious time...

Page 1 of 1 (7 items)