IIS restart is required to get new data - iis

Folks,
Steps to repro
HTML page makes a 'POST'action to a Web API to insert a record on a table.
Web API calls database and executes stored procedure
Data is insert into table correctly.
User reloads page (refresh page).
On refresh HTML page makes a new 'GET' action to Web API to get all records
Result
New record is not displayed. Only when IIS is restarted is the new record displayed
Expected Result
All data to display without a need for a IIS restart

Related

How does a website serve a list of data to the user for page/slider content?

im specifically talking about how when a user goes to a web page with a list of data (articles as an example) does the website send every article (maybe in an array or something) and then the client filters out the data to only visualize the articles for the page that the client is currently viewing? i'm referring to back/next buttons that will display different "pages" of data not different actual web pages (changes in url) or if it doesn't work like that then how does it?
I am assuming, your question is basically without the URL changing the data in the page changes and how this takes place.
So, for this what happens behind the scene is that for every action performed by the user a request is sent and the corresponding data is retrieved and displayed, and this is irrespective of the URL.
for example initially,
When the user lands on the page the list of all articles is retrieved and displayed.
Now, if he applies a filter, a request is sent and then data received is displayed.
So as you can see this process is irrespective of changes in the URL.

Configuring GTM to set a field on page view after the page has loaded

Maybe this isn't possible, but here's the situation.
I am trying to track user ID's on my sharepoint pages in google analytics, on page view. Because I have to use sharepoint's SP.js script to get the currently logged in user to retrieve their ID, I am using SP.SOD.executeOrDelayUntilScriptLoaded to run the part of my javascript that gets the user id and then pushes it to the dataLayer.
Unfortunately because of having to wait for the SP.js script to be loaded the userid value is pushed to the datalayer after the GTM container has loaded and so shows up as undefined in the PageView tag on Tag Manager.
I have thought about putting the GTM container into my script after it has obtained the user id, but I'm not sure what that means for the non-javascript part of the container:
<noscript>
<iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXXX" height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>
My work around has been to fire an event when I have the userid and send an event to Google Tag Manager, but this means that the userId shows up as an event and not as part of page view.
So is it possible to set a field in the Google Analytics Page View event after the tag manager container has loaded?
The answer here is no. Once the page view is recorded, you cannot set a field for that same page view once tracking has occurred. What you are doing with events is exactly what you should be doing. The only other options you have are to delay recording the page view until your script finishes, but that means late-loading tags, hence a percentage of missed page views being recorded, or you could simply let the first page view be recorded without the user id, then set a cookie so it is recorded on all subsequent page views. An additional option, you could set the user id as a cookie on the browser for up to a year after the session starts. Then anytime that person comes back, you would conveniently already have the user id.
You can create a Virtual Pageview and set a trigger when the user id is available but then this will increase the amount of Pageviews on your site.
How about moving the script above the GTM container? so that way the SP.js script loads first

play back error in mtm 2012,microsoft visual studio 2012

We have Angular Single Page Application for which we are creating test cases.
We have a test case written for Login page (loading of page, username, password entry, and login btn click action). While recording the actions the flow is as expected and once the validations are met the page is transferred to our applications home page.
However when we playback the recording the all actions take place as excepted and we get replies for login api calls. But the browser doesn't get transferred to applications home page. Its stuck on the login page forever.
And this case only happens in Single Page Application. When we try the same in Normal web application it works perfectly fine. The page gets transferred as expected in the playback.
And i have tired in coded ui test for existing recording,the browser doesn't get transferred to the application home page.
Could you let us know what should we investigate and how to proceed further.

How can I refresh the XPages File Download Control and have it display updated attachments without full page refresh?

When I create file download control on a document I can display the attached files from a Rich Text Field.
In a separate process I am attaching more documents to the same document. I want to periodically refresh the download control container to see if there are new attachments. I do not want to do a full refresh of the page.
I have discovered that the partialRefresh of the file download control container either programmatically or manually does not result in the contents (downloadable files) being accurately updated.
XSP.partialRefreshGet('view:_id1:fileDownload1')
A full refresh of the screen shows the newly attached documents but I want to be able to partial refresh the panel container and see the new documents without full page refresh.
I have added a Random() computed text value into the panel and I can see that it is being refreshing correctly. I have even looked at the xhr response from the server and I can see that there is an update being made - but not with the new attachments in it - the "attached files" are not refreshing without full page refresh.
I can only assume this is a feature of the filedownload control in that it does not know that new files are attached at any other time other than page load.
Suggestions?
When partially refreshing a XPage, the datasources are not reloaded, only their last state (stored in memory or hdd ) is restored. If you change the scope of your datasource to request, the XPages engine is forced to recreate the datasource instead of using the cached one on each request (which includes partial refreshs).
This should allow you to refresh your fileDownload control without a full refresh.
Marky,
Yes, I have run into this before. You must do a full refresh with attachments.
http://xpagesblog.com/XPagesHome.nsf/Entry.xsp?documentId=FBAC0D921B677EA0852578CB006678D7
The link is fairly old, but I believe it still applies.
Matt White says in the article comments: "...Basically it is not currently possible to post a file attachment over AJAX, you either have to use Flash or a virtual iFrame solution if you don't want the entire page to refresh. As far as I know there is nothing that IBM can do about this at the moment.
Matt"

PageLoad not called in Sharepoint web part

I have a number of pages with custom harepoint visual web parts. In the page load of these web parts, i am doing some logic which i need to trigger every time the page loads. the problem is that when i use the browser back button, or javascript, to redirect the user to the previous page, the pageload is not being invoked. it seems like the page is being retrieved from a cache. can this be disabled easily? is there any other workaround to ensure that the code fires every time the page is rendered?
Using the back button will load from cache, you are correct in that.
To disable cache, you need to set an "expires" = -1 meta tag in the head section of the page but this seems a bit drastic in order to fire logic for a page.
I'd suggest using the jQuery document ready approach rather than page load. This will fire regardless of where the page information is loaded from.
$(document).ready(function() {
// Insert code here
});

Resources