ASP.NET Dynamic Data - Back Button - filter

I used .Net's dynamic data entity to implement a website that sits on top of my db (see
http://msdn.microsoft.com/en-us/library/ee845452.aspx)
In the List.aspx-View for a table, I am able to sort/filter the data of the gridview. After having clicked on a row's 'Details' link, I would like to provide the user a 'Back' button in the Details-View that navigates the user back to exactly the same filtered/sorted table.
So far, all sorting and filtering information is lost when navigating back to List.aspx.
Any ideas how to implement this feature? Do I need to work with ViewState?
Thanks a lot
Cheers
Chris

have a look at my article here
AJAX History in a Dynamic Data Website this works when using the back button in the browser to navigate back to the List page.

Related

MVC Ajax form and browser back button

I am currently working on an MVC site which has a search page that sits behind a login page. When the user logs in, they are redirected to the search page.
The search form uses an ajax form that returns search results to the same view.
When we have search results, the search form is no longer shown. This all works fine.
However, once you have fired off the form and have search results - the user will probably try and hit the browser back button to try and get back to the search form. Of course, this instead takes them to the previous page (the login page).
So, my question is this - I would still like to keep the form and results on the same page using ajax. Is there anyway that I can achieve this, in conjunction with when the user clicks back, it takes them to the search form?
I appreciate I am probably asking for too much here, but I thought I'd put it out there anyway!
ps - I already have a 'back to search' link which re-loads the form. I believe the average user will try and click the browser back button. I would also rather not have some sort of function on the login page that redirects them back to the search page.
You need to use the History API. It's supported in modern browsers, and there's a polyfill for IE9 and below.
UPDATE
For what it's worth, I agree with #TravisJ. This is a bad design, but if you insist on going down this path, then my notes above apply.

profile picture upload laravel & foundation framework

I have a registration form completed and would like to add a profile picture upload. Once the user clicks the browse, he can select the photo. Then he clicks ok/apply/ok and then the photo is reflected in the thumbnail area without page refreshing.
Once the user is happy with all fields input he can submit the form and with it the photo of course.
Anything that does this exists out there already? If not, please provide guidance on how to establish this feature.
Thanks,
I'm not aware of a ready made solution for this but there probably is something :-)
However, with Laravel this is beautifully simple. You've tagged your question ajax but I'll answer this assuming you're going to use an old fashioned server round trip (i.e a form submit).
1) In your template, add a file element to the form. http://laravel.com/docs/html#file-input
2) Add some javascript to the page that detects when a file is selected and shows the preview. Extensive tutorial here: http://www.html5rocks.com/en/tutorials/file/dndfiles/
3) In your controller, handle the file using the Input facade. http://laravel.com/docs/requests#files

Need to Display Buttons in Magento Frontend

I am new to Magento enterprise edition. I need to enable some buttons(Page, News & Video) regarding the product details in my front-end. On mouse click, i need to fetch data related to the product from another website through search key. Is there any solution through which we can directly fetch the data on mouse click or is there any third party tool through which we can access data
As per your requirement an my understanding you need some data to be fetched from another site on mouse click for a product.
On mouse click event you need to do an Ajax request passing the product id or something that is being identified and used by other site as a parameter

asp.net mvc3 persisting form data when user navigates to unrelated page

So a user fills out a form then decides to click on a unrelated link that happens to be on the page say to a disclaimer page. Then using internal site navigation (not the browser back button) comes back to the form he was on. The link back is an ActionLink.
What is the best way to keep his data on the form. I figure I'll have to serialize the data and save it. I can do a ajax call before going to the other page. I'm looking for the sexy solution. Something that will handle it on a global scale.
Is this even a standard practice?
HTTP is Stateless. You are trying to bring some Stateful nature it !
If you really want to keep the data, You can keep in the Session variable and access it there. You need to override the click event and (in javascript) send the form data to an action via jQuery ajax post where you store it into Session. You can access it later when you come back to this page.
Do you really want to do that ? I think 80 % people knows that once they click on another link, the data will go away. You could probably show some alert message to ask "Are you sure to leave this page" like stackoverflow does.

Back button to ajax results, advice request

I am trying solve the back button issue within my app. The scenario is:
I have a home page with a search form which sends and receives data with $.ajax(), then the results loaded through ajax, their links points to a controller that won't be done by GET in ajax so that means that the page will be refreshed (so the home page with the results looks like this: http://url/en/home and a result link may look like this http://url/fetch/data/x123av).
The problem is which is the best way fix that when click back button to return the results from the search box?
I have found some answers in stackoverflow related to my question:
http://code.google.com/p/reallysimplehistory
http://tkyk.github.com/jquery-history-plugin
But from the documentation of those plugins, they all work by checking the hash change which I don't have.
Hope I have explained well enough, and I do have searched stackoverflow and google for a solution but I didn't find one that is close to this or either I've jumped over it...
Please just point me to the right way :D
But from the documentation of those plugins, they all work by checking
the hash change which I don't have.
If you want to handle the back button with AJAX request you will have to redesign your application so that it works with hashes as that's the only way. Changing the fragment portion of an url doesn't trigger a page reload but it is added to the history, so when you press the back button you are able to detect this change without navigating away from the page.
As mentioned by SLaks in the comments section another possibility is to use the HTML5 history API but obviously this assumes that the client browser supports it.

Resources