Answered by:
How to ISOLATED sql data in Asp.net

Question
-
Hello i worked in window phone 8.1 application . in that we use ISOLATED storage or Local storage to store data .. same thing i want to ask is it possible in asp.net web application . like once user login the web query run and fetch data and store it some where like session or local storage . in that way client wont have to wait for server respond every time ?? Any one have any IDea ??
- Moved by Mike Danes Thursday, June 18, 2015 10:26 AM asp.net specific
Tuesday, June 16, 2015 6:43 AM
Answers
-
HTML5 offers client side storage - localstorage.
http://www.hongkiat.com/blog/html5-offline-storage/
http://www.codeguru.com/csharp/.net/two-ways-of-passing-html5-web-storage-data-to-asp.net.htm
$(document).ready(function () { var storage = window.localStorage; $("#Button1").click(function(evt) { storage.setItem("fullname", $("#TextBox1").val()); 5. storage.setItem("email", $("#TextBox2").val()); $("#Label3").html("Data saved to LocalStorage!"); evt.preventDefault(); }); });
- Proposed as answer by Cor Ligthert Tuesday, June 16, 2015 10:09 AM
- Marked as answer by Just Karl Tuesday, June 30, 2015 10:19 PM
Tuesday, June 16, 2015 9:38 AM
All replies
-
hello , use cache.. i use this for data sets
check if cache["yourNameHere"] == null then populate it from database
else do what you want with it..
it also has a stay alive property so if wil be autodeleted after an interval that you give..
Hope it helps. Spiri
Tuesday, June 16, 2015 6:54 AM -
"in that way client wont have to wait for server respond every time ??"
If you don't want the client to wait for the server then it means that you want the client, not the server, to store the data somewhere so this isn't exactly about ASP.NET. Please try clarifying your question and note that ASP.NET questions should be posted in the ASP.NET forums: http://forums.asp.net
Tuesday, June 16, 2015 7:32 AM -
Abdul,
No this is not possible since about 2003 all web browser builders have agreed that it becomes impossible to reach whatever memory of the client beside cookies, there has been to much fraud when other client memory was available.
No need to ask this in ASP.Net or you would create a kind of datastore on your server for clients.
Success
Cor- Edited by Cor Ligthert Tuesday, June 16, 2015 8:25 AM
Tuesday, June 16, 2015 8:25 AM -
"No this is not possible since about 2003 all web browser builders have agreed that it becomes impossible to reach whatever memory of the client beside cookies, there has been to much fraud when other client memory was available."
I know that the question is not very clear but that doesn't mean that one should post any nonsense is handy at the time...
Tuesday, June 16, 2015 8:33 AM -
"No this is not possible since about 2003 all web browser builders have agreed that it becomes impossible to reach whatever memory of the client beside cookies, there has been to much fraud when other client memory was available."
I know that the question is not very clear but that doesn't mean that one should post any nonsense is handy at the time...
@Mike Danes
Somehow you want to offend me, but in Framework 1.x there where ways to do this. That did not work at a certain moment, all VBA Com objects getting and setting the data of a client which was then still possible were made unusable.
So if you know it better, than show that and don't do likewise that by offending others.
This is what I know, if you know a better answer, show it, I'm not good in malicious code.
If you don't know what a Cookie is and also not what Isolated storage is, than avoid replies which only tell "f..k off"
Success
Cor
- Edited by Cor Ligthert Tuesday, June 16, 2015 9:01 AM
Tuesday, June 16, 2015 8:58 AM -
"Somehow you want to offend me"
No, I'm just being blunt. Given your track record of off-topic remarks and claims without any technical basis that's the best I can offer. Besides, a blunt and incorrect "you can't do that" doesn't deserve any less than a blunt "nonsense".
Tuesday, June 16, 2015 9:25 AM -
HTML5 offers client side storage - localstorage.
http://www.hongkiat.com/blog/html5-offline-storage/
http://www.codeguru.com/csharp/.net/two-ways-of-passing-html5-web-storage-data-to-asp.net.htm
$(document).ready(function () { var storage = window.localStorage; $("#Button1").click(function(evt) { storage.setItem("fullname", $("#TextBox1").val()); 5. storage.setItem("email", $("#TextBox2").val()); $("#Label3").html("Data saved to LocalStorage!"); evt.preventDefault(); }); });
- Proposed as answer by Cor Ligthert Tuesday, June 16, 2015 10:09 AM
- Marked as answer by Just Karl Tuesday, June 30, 2015 10:19 PM
Tuesday, June 16, 2015 9:38 AM -
hello , use cache.. i use this for data sets
check if cache["yourNameHere"] == null then populate it from database
else do what you want with it..
it also has a stay alive property so if wil be autodeleted after an interval that you give..
Hope it helps. Spiri
Cache is great if you want to share data across all users.
Session is great for data specific to the user.
( Don't get too carried away with them - if you have a lot of concurrent users over use of session can eat up memory ).
Both are on the web server though - you would need a connection and you would need to wait to get the data from the server. To my mind, they don't seem very like isolated storage.
I assume that means they won't satisfy Abdul's requirement.
Tuesday, June 16, 2015 9:47 AM -
Thanks Andy,
I did not yet know about this feature in HTML 5.
''In far future governments wants probably a kind of stop of it likewise for Cookies"
:-)
Success
Cor- Edited by Cor Ligthert Tuesday, June 16, 2015 10:10 AM
Tuesday, June 16, 2015 10:09 AM -
It's been around for a while, but it's kind of tricky and the web is kind of intended to be stateless so it's possible to work on web apps for years and never see it used.
There was also google gears. That got everyone excited and then google dropped the thing. I saw a huge project shot out the water by that process.
And of course Silverlight has Isolated storage which you could use without ever seeing a Silverlight control. This is headed towards oblivion after MS put it on the back burner a few years back though. A real pity that, although being a some time silvelight dev I might be a tad biased. And somewhat bitter.
.
Where was I now.
.
It would be great if people answering questions - we "experts" - knew everything and absolutely never made a mistake.
Perfection isn't attainable though.
Which is the value of peer review.
It would also be great if we "experts" had infinite time and patience and never got upset or felt the need for touching on personal comments etc etc etc.
Also inhuman.
We just have to bumble on, getting things wrong, overlooking stuff, misunderstanding questions, annoying each other without even really meaning to.... and....
Try our best to cut each other some slack, decide perceived sleights are probably not really intended in the worst light we imagine....
And generally get on with each other despite never meeting or knowing each other.
- Edited by Andy ONeill Tuesday, June 16, 2015 1:29 PM
Tuesday, June 16, 2015 1:26 PM -
The ASP.NET forum is where you should post.
Tuesday, June 16, 2015 3:25 PM -
hello i cant find where to answer sO im rplying in my post
weill i found a javascript i make changes in it by this i can save textbox value into localstorage in browser .. now im trying if i can save text so it can also save array and dataset and i can fetch it form it Correct me plz if im thinking wronghere is the code
<!DOCTYPE html> <html> <head> <title>!</title> </head> <body> <header> </header> <input type="text" id="txtUserName" /> <input type="button" value="Save" onclick="Save();" /> <input type="button" value="Retive" onclick="re();" /> <label id="msg" ></label> <script type="text/javascript"> function re() { if (localStorage) { var UserName = localStorage.getItem("UserName"); document.getElementById('txtUserName').value = UserName; } } function Save() { try { //If localStorage supports with the browser if (localStorage) { var txtValue = document.getElementById('txtUserName').value; localStorage.setItem("UserName", txtValue); document.getElementById('msg').innerHTML = "Saved Successfully!"; } } catch (err) { document.getElementById('msg').innerHTML = err.Description; } } </script> </body> </html>
- Edited by Abdul_Samad Thursday, June 18, 2015 6:01 AM speling change
Thursday, June 18, 2015 5:59 AM -
Abdul,
Your code has nothing to do with C# or even Asp.Net.
It is a piece of code in HTML and JavaScript which in my perception fails, simply because of the fact because localStorage is never defined.
However it is 100% of topic in this forum. Your option is in my idea the most simple a Cookie, search on Internet for it.
Success
CorThursday, June 18, 2015 7:22 AM -
Abdul,
The way these forums work is you ask a question - get an answer and mark it as answer.
That's why Cor has proposed my post up there as the answer.
.
If you then have another question you start a new thread.
The idea is that these are searchable.
.
This is a different question.
You should start a new thread.
Since this is pretty obviously javascript it's not c# and not something theoretical that could possibly even involve c#.
You therefore want a more appropriate forum for your new question.
Thursday, June 18, 2015 8:51 AM