I'm using FLEX for front side of my web application. My task now is to handle session timeout. I can capture session timeout now. What I want to do is let the user continue the session, meaning that let the user stay on the current page (for example, current menu selection or current table selected) and restore every content that users have put in the text field.
For example, there are four division in my menu: Front page,management,events and setting. When the user click "management", there would be some text fields like user name, address or other info. When the session is expired, the user can continue the session, staying on "management" state and regain what they have typed in the text fields. How to do that? Thank you for your reviewing!
You can create a in Flex component that periodically calls the back-end to keep the session opened.
You just need to display the login panel or whatever in front of the current "management" panel.
As soon as the user re logged in, just switch back to the previous configuration by hiding the the login panel and the user will be able to continue working without loosing anything.
HIH
M.
Related
Suppose I have a fragment account and there are three ways to access my app Register, Login and Skip for now. If an user clicks on skip for now, the components of my account fragment should be hidden and instead of all that, there must be one login button.
You can maintain it by setting a variable in shared preferences or you can set a global variable on the base of user's entry choice. Accordingly manage visibility of the content.
There is some generated contents with the links on an ASP.NET page, which is created after the user inputs values and hits a button. The links take the user to another page.
When the user hits the Back button, the generated content is gone as the page returns to its initial state with the inputs cleared and generated content not there.
Is it possible to preserve the state of the page after its content has been generated and restore it after the Back button was clicked?
I think you can you can you temporary cookies.
and on load check whether cookie is exists or not.
Save the inputs in the session, so that the page will know how to correctly render on later requests. Even better, have the first code that runs when the data is submitted redirect to new page with a URL parameter that you use to know which links to show. This is a called a POST-REDIRECT-GET pattern.
I was given a task to solve a bug on some old project that someone else wrote.
The project is ASP.Net deployed on IIS.
Scenario:
Open Request form.
Fill personal details.
Click button "Add Items" to open items selection window.
Select items and close the item selection windows.
Expected:
Back in Request form, it is now showing both the personal details, entered in
step 2 and now, on the same request page, the list of selected items, selected in step 4.
Actual:
Back in request form, not showing personal details and only showing
the selected items.
From the code I learn that every field on the request form is:
Saved to the session (E.g onChange in JavaScript call code-behind save
function)
Load from the session on Page_Load
I guess the above is needed as a replacment machanism for the ViewState,
because in the above scenario it is required for the form fields (E.g personal
details) to persist across several pages. (The opening of other windows
to add items...)
Also from the code I learn that items added on "Add Items" windows are:
Saved to the session in the page "Add Items"
Loaded from the session in the Page_Load of page "Request"
Now instead of working on the project over at the customer's offices we copied
the project and deployed it back in our offices - only problem is now it is
working fine - that is, both the personal details and the list of selected
items are showing as expected.
I would like any suggestions... What could be the cause of such
behavior?
Also in case I will not be able to recreate the problem on my environment,
what should I check/debug on the customer's office?
...What could be the cause of such behavior?
Based on your symptoms, it sounds like could be happening is the server is relying on a client-side script (to set the form values sent down from the server's response) that has a dependency (e.g. jQuery) that might not be supported by the (possibly outdated) browser being used.
...what should I check/debug on the customer's office?
Here is what I gather is supposed to be happening after the client has the form open:
User enters values in form control(s). ("Personal Details")
Client-side event handler sends asychronous requests to the server (no callback) in order to save form values to the user's Session.
User clicks a button. ("Add Items")
Client-side event handler opens a new window that sends a request to the server for the "Items Selection" page.
Response is received from the server and the "Items Selection" page is displayed on the client.
User selects values for controls. ("Items Selection")
User clicks a button ("Close Window")
Client-side event handler:
Sends a request (with the "Items Selection" values) on behalf of the previous window to the server for the "Personal Details" page.
Closes the current window.
Previous window receives response, page reloads completely, and all form data is still present (reloaded).
We know at the very least 9. isn't actually happening properly, since this is your stated problem.
Assuming I have your implementation correct, you should start by determining how the values are supposed to be written to the controls during the last step (e.g. server controls' values assigned directly or server registers start-up client-script to write the form values). Then you should check the values that are sent to the method you discovered. If the values are incorrect, keep backing up to each previous server request to see what is the resulting Session state before the response. If the values are correct then you know something is going wrong (most-likely client-side) after the client receives the response from the server (I think this should only happen if my jQuery theory above is correct).
If we store view state in DB, will the back button behaves the same way. Means if user has filled up some data one step-1 of 3 and goes to second page, but wants to change something on first page so hits back button, will he see the same info he filled up? or it will be blank?
Please clarify.
Is there any article for when to go for server side view state?
thanks.
I am developing a page whereby users can login and demo some pieces of functionality. I only want to allow the user to demo this once per day.
A small example:
I have a web page with 3 buttons (relating to 3 different scenarios). On page load, I look up the database and check if the current logged in user has run any one of the 3 scenarios available (via an audit table). Each button is enabled/disabled based on the results. If any buttons are enabled, then they have not run that demo yet. By clicking the relative button, the demo runs a record is written into the Audit Table, and the button is disabled.
This was working ok, however, I realised that when I refresh the page (and confirm I want to re-submit the information) the demo runs again.
How can I stop this from happening? I need to only allow the user to run the demo once!
Thanks.
I would suggest that you change your form submission to use the Post/Redirect/Get pattern to avoid a resubmission if they hit refresh on the demo page.
Also, it seems like you should just be able to change the code at the point where it writes the record into the audit table to check to see if the record already exists, and if so, return a different result. I'd be pretty wary about this approach though. The "refresh" functionality of the browser isn't generally something you should be trying to prevent. What happens if a user hits "refresh" in the middle of their demo?
you can check not only on the page load to enable/disable the buttons, but on the button events, you can verify if that task has already been performed