Browser back button does not move to the previous View - asp.net

I am using views concept in my asp.net form control.my first view consist of a form to capture user details.when user press continue it will move to the second view.
The problem is ,When user press the back button of the browser from the second view it doesn't move the the previous view instead move to the previous page in the browser history.
I wanted to move to the first view with the existing data in the form,when user press the back button of the browser.

You should perform a full page postback I guess, so that at client end your previous view will be saved in browser's history.

Related

Is there an option to track(goals) ajax form with checkbox that works screen by screen?

I have an ajax form with some questions of choice but every question will be displayed on new screen (screen by screen) by button.
I want to track users behavior on my form page. I want to know after which question user has left the page (which questions they filled up)
Also I would like to know from which devices they have visited the form page and how long they were on this page
Is it possible to track all of this by GA or GTM?
If the form is screen-by-screen as you said, it sounds like you need to track two things.
An event for clicking the "Next" button
A virtual pageview for each screen.
This way, you can look into your Exit Pages report to see what screen the left the page from.
As for device tracking information, that type of data is automatically captured by GA.
So, basically. You'd have a virtual pageview for the first screen (assuming this form is a popup modal). If it's not a popup modal, then you'd just have the normal pageview for that first screen.
For instance, if the user has to click a link/button for the form to start, then you'd, ideally, fire an event for clicking that link/button, fire a virtual pageview when the first screen loads, fire an event when the user clicks the next button, then rinse and repeat for the subsequent screens.
Also, it may be a good idea to track the last screen's "next" button (or "finish") button as a separate event. Then, you can see in your events report who has filled out all of the screens and submitted.
Another thing worth pointing out: If you also want to show which question was the last one filled out, you can provide the name of the question (or an id, or some kind of brief and canonical identifier) in the virtual pageview as a custom dimension.

Force page reload on browser back when the fragment identifier changes

Problem:
1.User clicks on this link: default.aspx#id=1.
2.The page loads, the JS from the page gets the fragment identifier (in this case id=1), and then it posts back and loads some content based on that id.
3.User then clicks on the next link: default.aspx#id=2.
4.Same as 2.
5.User clicks the back button in browser.
6.The url changes back to default.aspx#id=1 but the postback is not fired so the new content from #id=1 is not loaded again. (in other words, the page content is not refreshed)
What i need is to somehow reload the page according to #id=1 on back button pressed.
Thanks!

listview itemcommand not firing after back button

I have page that uses a multiview. Each view contains a separate user control. One of these user controls has a list view with an image button that causes the loading of a different view in the multiview. All is fine up until this point. When the user hits the back button, they are taken back to the user control that contains the list view. The user then clicks on another image button to view different data and it returns to the detail user control using the same data as before. While debugging, I have seen that the item command event does not fire after hitting the back button.
I have tried replacing the multiview and putting each user control into separate panels. This did not change the outcome at all.
I have tried setting a cookie that expires 5 seconds after page load. When the user continues to the next page, then clicks back (and it has been longer than 5 seconds), I force the form to submit again. This loads the next control again instead of reloading the page.
I have tried setting the cacheability to no cache. This causes a "page expired" message and the user has to refresh the page. This is ugly for the user and definitely takes away from the user experience.
I am looking for the cleanest way for a user to click back and have the page reloaded so that the item command event fires correctly again.
The reason is that Back doesn't affect the Page Life Cycle. It's definitely because the page is cached and cached page doesn't execute on server. You can try this code to get rid of this issue.
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
It took a lot of research to find this answer, so hopefully other people stumble upon this question and find my answer. I was astonished that I was actually able to find this. Ok, enough gloating.
Because the page does not postback when the user clicks the back button, the events are not fired correctly causing problems with the next page. What has to happen is you need to be able to handle the browser's navigation buttons (i.e. back and forward). To do this you have to set EnableHistory to true within the script manager and handle the Navigate event from the script manager. You can then reload the controls using the information you save in the state object.
I used these articles from Dino Esposito on DotNetSlackers.com as a reference. Server Side History Management and Client Side History Management

Previous page should remain in same state when back button of browser is click

I have a page on which there are two drop down lists, based on the selection of those dropdown lists grid view is filled. In grid view there are imagebuttons. When user clicks on any of the image button, he/she is redirected to another page. Now when I click on the back button of the browser, I want page in the same state as it was before redirect. How can I achieve this goal??
use ASP.NET Multiview control instead of separate two pages this will create one page with two views which will effectively retain page state.
Please refer to these articles
http://www.beansoftware.com/ASP.NET-Tutorials/MultiView-Control.aspx
code project multiview

which Asp.net page properties to work with ...? please find details below

I am having an application where I am displaying an modal dialog if the page is getting loaded for first time but when i navigate to any other page within the web site then also the modal dialog get displayed what i need is modal diaolg should get displayed only for first time and not while navigating within web site. "Just one time display of modal dialog to user not again and again if user navigates within website"
The modal dialog is coming from javascript and i am using asp.net 3.5
and not using ispostback any suggestion or condition other than ispostback is needed
Is there any property of page which is true/false for first time the page is loaded and gets false/true when the user navigates to other page within website...?
any way/logic to do it ...?
Thanks,
Nilesh
There is no property that will allow you to determine whether the pageis accessed for the first time or not. One way to handle this is to use a Session variable where you could store whether the user has already visited the first page.

Resources