Browser back button with update panels - c#

In an asp.net/c# application, I have an update panel on my main page. And everything on the page is updated via the update panel.
So there is only one page and all the changes are made in update panels using asynchronous postback (partial postback)
My question is: Is there a way to make the browser BACK button works and return the page to it's previous state?
Hope I was clear
Thank you very much for any help
more info: I tried to implement this http://rchern.wordpress.com/2008/05/11/updatepanel-backforward-browser-navigation/ but I wasn't able to make it work.

This is often a problem you could look at the resources mentioned in the answer to this question:
How to save history within UpdatePanel?

Related

Want to refresh My Parent page from with the popup page in c#

I have a page where I am getting a popup on button click and popup it self is a page with usercontrol on it.Now my problem is that on user control which is on popup page I want to refresh parent page of popup page when popup is closed.Any help will be appreciated.
This cannot be done, should not be done, and anyone contemplating doing any such similar should be frogmarched out back and beaten until their buttocks are purple.
If I would do this personally, although I highly recommend avoiding this type of solution, I would not solve it solely on client side because it is difficult to verify that all browsers and all client will work as intended. Instead, consider signaling the server upon closing the popup-dialog - using the window.onbeforeunload event. You may then implement an asynchronous JS solution between your parent dialog and the server where the server can notify the client to update when the popup is closed.
But, please do consider implementing the "popup" as part of the parent page instead and maybe have a master user control that may update the page.
Simple use the below line while closing the popup it will automatically refresh the parent page.
window.location.href = window.location.href;

asp.net updatepanel blocking clicks

I have an asp.net 4.0 web forms application that I'm working on and I'm trying to modify the behavior of an updatepanel.
The current behavior is that while the update panel loads, I can click on links but they don't work until the panel is finished loading. Because the panel takes a long time to load, users are blocked from navigating the page and I need to figure out a way to fix that.
Does anyone have a good idea on how to accomplish this?
Thanks!
A better suggestion is to use triggers as described here: How can I defer loading UpdatePanel content until after the page renders?
There could be another way where you hide the panel while the update in progress as described here: Hide UpdatePanel during UpdateProgress
May I also suggest you to study Understanding ASP.NET AJAX UpdatePanel Triggers because this will help you to create a better solution fit for your project.

facebox in asp.net cannot postback

i have an aspx page with feedback form which rendered inside facebox. In the form, i have a button which used to submit the form. After this, the facebox closes and its opening the page which is loading in the facebox in another page. I did go through many q&a here and tried on many suggested answers such as the link attached as below but unfortunately I still cannot figure it out.
http://weblogs.asp.net/kariemsoudy/archive/2009/11/02/buttons-inside-facebox-popup-don-t-postback-fix.aspx
Facebox adding commas to input
Appreciate for any reply. thanks in advance.
You might want to try sticking your app in an UpdatePanel so that when you postback in your section it's not posting back the entire site to FaceBook. I'm not sure how your site is embedded into facebook, but if possible you might also try using iFrames to do the same thing (so that you're only posting back your frame, and not the entire facebook page). My guess is that the postback to facebook results in your page being overwritten (by facebook).
If you are having issues with posting back, the easiest way to force the postback is to trigger the __doPostBack method as in:
__doPostBack('uniqueid', 'args');
Regardless of the issue with the button click, this should do the job.

Webforms Refresh problem

This is probably a simple question for every WebForms developer but I am knew to this scene. I have a page that has an "ADD" button on it that results in a jquery popup where the user can submit a form that will add an entry to the repeater on the page. My problem is that after the user adds an item, if they then hit the refresh button the item will get added again. I can't stop this with the page.ispostback because that would block the original add. What can I do here?
that's a common problem. Here's explanation and solution of the problem.
When a web form is submitted to a server through an HTTP POST request, a web user that attempts to refresh the server response in certain user agents can cause the contents of the original HTTP POST request to be resubmitted, possibly causing undesired results, such as a duplicate web purchase.
To avoid this problem, many web developers use the PRG(Post/Redirect/Get) pattern.
copied from wiki (LINK)
simplest solution can be Response.Redirect to the same page (i.e. if you page is named default.aspx write Response.Redirect("default.aspx")). if you do this browser refresh button will just load the page as if you have typed in address bar URL and navigated to it.
here's SO question How to stop unwanted postback that might be useful as well.
If there is an option to delete an item on the page (is there?), do you really have to be concerned with that happening? May want to think about that. Just a thought.

Ajax Facebook Like & Sharethis Postback Problem

I am having problems displaying both Facebook Like and Sharethis widgets to show up on postback event, initial load displays them perfectly, but as soon as page invokes partial postback and since both widgets are wrapped in update pannel, the elements disappear from the page.
Note: I tried the iframe solution for the facebook like button, which is now giving me another problem with not being able to reach the page, even though with current method outside of the update panel it's working correctly.
any help would be appreciated.

Categories

Resources