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.

HTML5 Integration with Asp.net for local storage in web database

Discussion in 'C#' started by javascript, Jan 17, 2012.

  1. #1
    Hello all,
    SEMrush
    I need to integrate html5 with Asp.net to reduce the response time of server by storing the data from the server (caching) locally in web database. Please help me to do this




    Thanking you
     
    javascript, Jan 17, 2012 IP
    SEMrush
  2. varrav

    varrav Member

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    26
    #2
    I guess you mean using HTML5 localstorage to store in the web browser client? It's pretty easy with some simple javascript. Just include it in your aspx page. Here's an example from w3schools:

    if (localStorage.clickcount)
    {
    localStorage.clickcount = localStorage.clickcount + 1;
    }
    else
    {
    localStorage.clickcount = 1;
    }

    Don't forget to check if the web browser supports localStorage:

    if(typeof(Storage)!=="undefined")
    {
    // Yes! localStorage and sessionStorage support!
    // Some code.....
    }
    else
    {
    // Sorry! No web storage support..
    }
     
    varrav, Jun 6, 2012 IP