preventing IE Silverlight caching values in a grid - silverlight

I have a silverlight application that displays some values in a grid. Another part of the application updates those values and saves the updates to the source data. All of this works fine including the updating of the displayed values in the grid...until you navigate back to the page later (by say hitting refresh). Then magically all the values in the grid are back to whatever they were the first time you went to the page. I can check and verify that the data is in the source system correctly, I can also make it work fine by going into internet options and setting the browsing history to look for a new version of the page every time you visit the page. But I can't guarantee that users will do this.
I have run into this MANY times before with IE but the normal fixes don't seem to work here. I have added a timestamp to the request for the XAP file to ensure that the file is being pulled every time but somehow that is not good enough. I've also added the pragma no-cache tag to the page and still no go. It seems like Silverlight itself is it's own special case. IS there something else that can be done in the SL object to make it refresh every visit??

What code are you using to populate the grid?
If you load the data when the page is created then it will only be pulled from the database once.
If you load the data when the page is loaded or navigated to then it will be pulled from the database every time the page is displayed.
As Ken Smith says in his comment:
move your data retrieval and population code to your main form's OnNavigate event, and out of Application_Startup
This means that if you update the data and then refresh the page it should show the new values.
(I can't be 100% certain without the code)

Related

Local chat in tabs without backend

I'm trying to create a chat in React that will be attached to a browser tab. The message history must be global. I put each message to local storage with a unique name. However, in the second tab, messages appear only after the page is refreshed. If you do not refresh the page, but write something new from the second tab, the values ​​​​in localstorage begin to be overwritten.
I tried to use broadcastmessage, but I ran into the fact that it is called many times, and many identical values ​​come to localstorage at once. I didn't find a solution to this problem.
I also tried using add.edeventListener('storage') but it doesn't work for the current tab.
I also used windows.postmessage, but that didn't work either. Can you suggest how to display messages without reloading the page?

Google glass clear cache

I was trying to resize an image to fit into a timeline template. (if it matters, I'm using the html attribute of the timeline) However, it was not rendering it properly. I got frustrated. Then I figured out that glass is using the same image. I just changed the name of the image and the url and it worked. Is there a way to clear the cache ? There might be a scenario where you change images on the server side and have the same timeline item (say a pinned item) access them at some other time interval. Thoughts ?
UPDATE
Request submitted in issue tracker
https://code.google.com/p/google-glass-api/issues/detail?id=30&thanks=30&ts=1367387959
There's no built in feature that triggers the timeline to clear it's cache, but it does respect the cache headers that you set. During development, use cache control headers to prevent the image from being cached.
If this isn't possible, you can work around this by adding a random GET parameter to the end of the image URL when you insert the card into your user's timeline.
All that being said, this seems like a useful development feature. You may want to request it in the API issue tracker.
put the same answer on your g+ but here it goes:
If you can enable adb, try using "adb reboot recovery" and see if you can get the option to pop up there.
Usually to get a menu up in recovery you have to press power and the up volume key (which i would assume would be the only other key on glass in this case) at the same time. then the volume key(s) scroll through options and the power button selects one.
Let me know if it works out.

Silverlight Refresh data

I don't know what is the best way to force a browser refresh when using silverlight.
The scenario is like this:
We have a silverlight application hosted on IIS
Two users opens the same page and that page contains a grid with some records.
Only one of the users modify one record and save the data in the database
How can the other user see that the data has been modified unless he refreshes the page manually?
Should I implement some automatic refresh?
Thanks in advance
I would think long and hard about the requirements here before you open up a can of worms. Is the grid editable? With the automatic refresh idea what happens to the user who is in the middle of an edit? Think about alternatives. Could you possilbly check whether the data has changed at the point of saving data and then provide an appropriate message to the user? If you want the data to automatically refresh you are going to get into looking at server to client notifications e.g WCF duplex calls or constant polling and refreshing of the underlying bound observablecollection

Load Testing in VS 2010

I am performing a webtest containing 3 pages once of which is a Silverlight page and a Controller page (every page is invoked from controller page and again the control is given back to Controller page).
When the 1st link id clicked it generates one ID that has to be carried forward in every transaction till the completion of the transaction.
The 1st page is a Silverlight page it interacts thorough WCF services to do the transaction.while submitting A request through Silver light the WCF service generates a ID but since the data from the service is returned in XML form, the entire output of the wcfservice if treated as a string data of which is hardcoded which is found at the time of recording.
So, After coming back from the 1st page (silverlight) to the Controller page it is always coming with the same ID which is stored as a string in the service in the recorded test. Since I am not getting the PROPER ID I am not able to move forward to other pages.
Actually, according to me system is not detecting the data returned from a WCF web service as a dynamic one and instead treating it as a hardcoded string.
How to resolve it, please help.
Some errors of Load test are written below:
Extraction Rule Error ExtractValues event 139 No hidden fields were found in the response.
Exception WebTestException 84 There is no context parameter with the name '$HIDDEN1.ConfiguratorTracker$hdnWorkFlowGuid' in the WebTestContext
Make sure you've created an Extraction Rule that is based on the Text Response and not a hidden field. You might want to take a look at a RegEx Extraction Rule.

IE7 problem - session and cookie problem

I have one problem with IE7. Let me explain the scenario
I have opened my web based application in IE7 browser in TAB1 by using normal login feature. After successful login, i entered to the application home page and i do with my normal transaction say Trans1. Now i want to open my application again in another tab TAB2 in the same browser window.. what happens IE7 won't allow me to login on my application in the login page, it directly enters to the home page and when i do one transaction say "Trans2" it is going smoothly. Now when i again went to the TAB1 and doing one transaction it is opening the TAB2 page that i opened in TAB2.
It seems IE7 is sharing same session cookie in multiple tabs. Is there a workaround for the same scenario.
Anyone have any solution for this problem.
Appreaciate your help in this regard.
Thanks,
Manoja Swaro
It seems IE7 is sharing same session cookie in multiple tabs. Is there a workaround for the same scenario.
Well no. Cookies are by design shared between all instances of the same browser, whether in multiple tabs or multiple windows. You can only get two separate sessions by using different browsers, like an instance of IE and one of Firefox.
This changes a little in IE8, but in quite a complicated way you probably don't want to rely on. See http://blogs.msdn.com/ie/archive/2009/05/06/session-cookies-sessionstorage-and-ie8.aspx
This is why you should generally not be using cookies/sessions for keeping track of partially-completed transactions; one transaction will always interfere with the other. Better to either:
keep track of all incomplete transaction data in page/form data, like hidden fields
if that's too much data to keep passing back and forth, create an ID for the transaction that is remembered through page data, and store the actual data in the database.
You can also use a unique ID tied to the page to generate more unique cookie names, eg. 'preference.1234=foo' instead of just 'preference=foo', so that each instance will have its own cookies.
Yes. IE shares session/cookie between tabs.
Try to run a new browser (i.e. from Start menu) -- it helped with older versions of IE
and it works with my IE7.
AFAIK This happens with all tabbed browsers (FF for example).
Indeed, this is how all tabbed browsers work. Cookies are shared among all tabs. However they are not shared among multiple instances of the same application, but I doubt this will help you.
This is actually a serious problem for many applications. It is very difficult to keep track of the tabs - which are open, which are closed, when a new tab opens, and when an existing one makes a request.
There is one workaround I have found, but it's pretty messy. The idea is that you have to assign a unique ID to every tab yourself. Then, when a tab performs some actions, this ID has to be posted back to the server. Depending on the architecture of your application, the ID can be passed around in URLs or hidden form fields. If you're doing AJAX, this can make it easier to find a common place to add the ID. ASP.NET also has just one form at all times, so the hidden field is easy to do.
Naturally, on the server side you must check this ID and implement your own "tab sessions" based on it.

Resources