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

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

  1. #1
    Hello all,

    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
  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