HTML5 Local Storage data not reflected across active tabs/windows in IE 11 - asp.net

We have created a functionality where in we provide users to works with forms in an Offline Mode.
We are using HTML 5 Local Storage to store all the offline data.
All the forms have their own html files (for example:form-1.html,form-2.html.)
We have a parent html page which makes use of an iframe to load the requried html file based on the form selected from the drop down list.
After the user have made the modification in offline mode,the user can sync in their changes by logging to the ASP.Net WebSite.
The problem ,we are facing is that the copy of Local Storage that in modified by the user in the offline mode is not in sync when the user their to sync the changes to ASP.Net Website.
In short,when we examine the Local Storage in the IE console of the browser when we login to ASP.Net Website,it does not reflect the changes made to the Local Storage during the offline mode.
Both parent html page and the ASP.Net Website page is serverd from the same domain.
I came across this piece of article which says that this is an on going issue and it has not been fixed in IE 11.
IE and Local Storage Issues
Please see bullet# 3.
Has any one had the same kind of experience.?
Any work around?

I tested many ideas, for me attaching an empty event handler for onstorage property worked!
The WindowEventHandlers.onstorage property contains an event handler that runs when the storage event fires. This occurs when a storage area is changed (e.g. a new item is stored.)
here is my code
window.onstorage = function(e){};
Microsoft is well aware of the issue, but after about 3 years , there is still no fix and probably it will never be. more info here

This is a known bug: https://connect.microsoft.com/IE/feedback/details/812563/ie-11-local-storage-synchronization-issues
There is a workaround added to the bug report that you can use indexedDB, which is synchronized among frames. But before you can create a DB, the user need to give your web app permission to create a database.

Related

Firebase database empty tab, rules load indefinitely

I just created a firebase project. And the database in the console appears empty. On previous projects, when you clicked on the empty white area, you were able to create database items by hand.
But clicking it doesn't do anything.
The rules tab is loading indefinitely, and i can't type anything.
I'm on Chrome last version, do you encounter such problems by creating new projects?
Here are some screenshots:
Ok, quick answer to my own question as i wasn't able, from my Angular2 App, to interact with database as well via websocket.
I'm working in a company with a (strong) proxy setup file. Disabled it on windows settings and all works now perfectly. Firebase website appears to rely on websockets.
Hope this information can be useful to someone else!

Update preview is not working as expected - Tridion 2013sp1hr1

Currently facing some interesting behaviour of update preview functionality with XPM.
Post adding components to page XPM service/oData service pushed the data to db n respond back session based filter response.
Updated content is available at page source however update preview is not reflecting changes on page.
Looking for pointers to resolved thus issue.
We are using only one staging website which is enabled with XPM.
Session preview is in place.
Just thought, may be silly, same page getting edited with same credentials from different browser session break update preview?(Two or more Session Preview ID is getting created for same user is trying to edit the page from different machine (laptops) hence we are facing inconsistent behavior and session is getting locked e.t.)
Thanks ! Hiren Mistry

Make ASP.Net (C#) Web App Available Offline

I have been tasked with making my company's Web App available offline. Before I move to the actual development phase, I want to be sure that my current strategy will not turn out to be a bust.
I first thought about using html5 app cache but after doing some tests I found that it seems to not cache the server side operations but the actual html that is rendered (Please correct me if I'm wrong). This will not work because the rendered html depends upon who is currently logged in. From my tests, it always rendered the html as if the last person that logged in (online) is logging in.
My current strategy is this:
I cache only the login page and an offline (.html) page to correspond to each aspx page that will need to be available offline. Every successful login (online) results in creating or updating Web SQL Database or IndexDB (depending on browser) with all data needed for that person to operate offline including a table that will be used for login credentials. In this way the only requirement for logging in offline is logging in with your login credentials at least one time.
My concern is that I am overcomplicating it. In order to make this work, I will need to create an html page for each current page (a lot of pages) and I will have to rewrite everything that is currently being done on the server in JavaScript including validation, database calls, populating controls such as dropdown lists and data grids, etc. Also everything that I change in the future will require a subsequent offline change.
Is there an established best practice for what I am trying to do that I am overlooking or am I venturing into new ground?
Please refer to these links, which gives you some insight on what is to be achieved. I'm not sure these are best practices, but these will be good starting point.
http://www.c-sharpcorner.com/UploadFile/aravindbenator/offline-mvc3-application/
http://www.developerfusion.com/article/84438/isolated-storage/

can we see html localstorage content through client browser?

supppose I use html5 local storage for my website.
1)can End user see my local storage values through browser using view source code etc?
2)How can we enter data for HTML5 local storage as domain level, i dont want to add my records manually when page loads everytime?
3where will HTML5 local storage content be saved?
I)in client side?
II)in server side(webserver)
anyhelp please?
Not through view source, but many Developer Tools support this. So yes, a user could very easy figure out what the contents of their browser's localStorage is. For example, in Chrome, open the Developer Tools, and on the Resources tab select "Local Storage"
I think what you are asking for is "How to I add local storage without writing the code in every page". You would typically then put that code in a common .js file - and reference it whenever you needed it. If you need it in every page, then depending on which platform you are using, they probably have some sort of "master". ASP.NET WebForms has Master Pages, ASP.NET MVC has ViewStart, etc.
Client side. It's local storage - as in it is local to the browser.

Programmatically set name of file to upload in webpage

Is there a way to programmatically set the name of a file to be uploaded from a web page? I suspect that browser security restrictions make this impossible, but I'm hoping someone will prove me wrong.
I have a web application that needs to let the administrator upload HTML. The admin selects the HTML file, then the app uploads that file, plus figures out all the supporting files (images, stylesheet, etc) and uploads them too. There doesn't seem to be a way to programmatically upload the supporting files from a web page, since the user has to specify each file explicitly.
Currently I have a separate Windows app to do this, but it would be ideal to have this functionality integrated with the rest of the app. My back end is ASP.NET with C#.
There is no way to programatically grab files from a user's computer via the browser. This would be a security violation if a website could just grab things.
Yes you can (in modern browsers)...
You can get and set the value of HTMLInputElement.files.
See this answer.
No, you cannot do this without a client-side application or special plug-in.
Browser security doesn't allow the server to obtain information about the hard drive contents of the client.
You may be able to do this using some form of browser plug-in. This is more work for you (and there are potential security implications for this beyond those found when you just have users run your app). However, it may prevent a more integrated experience for your users. I'd hesitate to eliminate the application completely, though. Browser compatibility issues are common.

Resources