1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to silently call an ASP page?

Discussion in 'C#' started by aab1, Mar 4, 2011.

  1. #1
    My webpage syncs data from another site which can take a short while especially if the user's account has a lot of items in it.

    To speed things up I made it cache the data to my local DB and only update it every few minutes (the users can choose the interval in their account settings).

    This still leaves the problem that the refresh after that interval will be slow like before.

    I'd like a way to "silently" update the DB after the page has loaded, not as it loads which causes it to take a long time to load.

    One idea would be to put an invisible 1x1 pixel image that links to an ASP page that would run the update script and then redirect to a transparent image, but there must be a way of doing this without having to put an invisible image.

    What would be the proper way of doing this? Calling a blank javascript from an ASP file would probably be better (like <script src="updatedb.asp"></script>) but is there a better option?

    Thanks
     
    aab1, Mar 4, 2011 IP
  2. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Ajax. But I'd just stick to the image, that way non-javascript browsers it will still work.. why not just stick with the image?
     
    camjohnson95, Mar 5, 2011 IP
  3. aab1

    aab1 Member Affiliate Manager

    Messages:
    202
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    38
    #3
    Really? I thought that would be an unprofessional way of doing it.

    I've never used ajax but I want my site to work on even the most basic of browsers like on cell phones, so perhaps the image is better.

    Thanks
     
    aab1, Mar 5, 2011 IP
  4. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Unless anyone's willing to point out any disadvantages or reasons as to why it would be "unprofessional"? I couldn't see why... It's the most practical and efficient way to achieve the same result...
     
    camjohnson95, Mar 6, 2011 IP
  5. wsrinivas

    wsrinivas Member

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #5
    Ajax is your best bet, Also you can use an Iframe with a seprate Page to update the database
     
    wsrinivas, Mar 16, 2011 IP