1

I am using the below code to store data using jstorage. i can;t understand what is load_data_from_server(). Please help me to call a code behind function from jstorage

<script src="prototype.js"></script>
<script src="jstorage.js"></script>
<script>
// Check if "key" exists in the storage
var value = $.jStorage.get("key");
if(!value){
    // if not - load the data from the server
    value = "hai";
    value = load_data_from_server() //I want to call c# code behind function here
    // and save it
    $.jStorage.set("key",value);
}
</script>
user2176150
  • 303
  • 3
  • 12
  • 21
  • Any time you want to call server code from the client side, the most common solution is to use AJAX. This is made pretty easy with WebAPI in C# to expose the method and a variety of JavaScript libraries that let you call AJAX easily. – Timothy Walters Sep 18 '13 at 04:46

0 Answers0