asp.net updatepanel blocking clicks - c#

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.

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;

Browser back button with update panels

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?

Display data in a popup window in ASP.NET using jQuery?

I am making an ASP.NET application. I have a page which displays a list of data [as a GridView].
I need to display a list of objects [as a GridView] in a new view over the current view, not a new window but a kind of AJAX popup, so that the context shiftes on the page to the new view/form!!
Shall i use Modal Window for this? If so, how shall I do it, as the function to open the modal shall be fired when an item of the GridView is selected?
Is there any plugin which can simplify my task?
You could always try the ASP.net Ajax Control Toolkit
http://www.asp.net/ajax/ajaxcontroltoolkit/samples/modalpopup/modalpopup.aspx
It supported by the ASP.net team and it's really easy to use!
There is a good plugin called blockUI for jQuery that will let you achieve this quite easily.
You can use it to show any HTML that you desire or even load an iFrame using that. You can download this plugin and find examples here
http://jquery.malsup.com/block/
If you post some sample code I can probably help you create your modal pop up!
Please do vote up my answer or mark the checkbox next to it, if I helped you at all. Thanks :)

to show loading while navigating a web page using c# .net browser

hiii
I am developing a window application in which I am showing a web page using c# .net browser. since my web page is quite heavy and its taking time to load . so i want to show loading image while navigating a web page .so tell me how should i do .
I assume that you are using the WebBrowser wrapper, is that correct?
You can use the ProgressChanged and/or Navigating + DocumentCompleted events.
As an asside:
Depending on the nature of your application you could pre-download parts of the page to improve the user’s pereption of the app’s responsiveness.
It may sound overly simple, but it might be the easiest solution to just add an image control with an animated bitmap to the form at runtime when the page starts loading. Once it's done, just hide the image again. This would also give you the flexability to display any messages you want and add effects/transitions to make it aesthetically pleasing.
Only since you asked so nicely.
You could just do this by monitoring both the navigating and the documentcompleted events of the webbrowser control. (Im sure you can fill in the blanks here).
Be sure when you use the documentcompleted event that you check the readystate :
theBrowser.ReadyState == WebBrowserReadyState.Complete
Otherwise the documentcompleted event will fire multiple times even before the entire page has loaded.
First create an image(give a name for it) and place it wherever you want it but make the Visibility to Collapsed.
Then in your browser_Navigating, add this code, ImageName.Visibility = Visibility.Visible;
and then in your browser_Navigated, add this code, ImageName.Visibility = Visibility.Collapsed;

full postbacks with ASP.Net AJAX on an ASP.NET page within an IFRAME

I have an ASP.Net page that is contained within an iframe the page has an update panel, that, in isolation, works however when the page is within the iframe, the update panel always produces a full postback. I guess that the problem is the iframe itself but id like to know
a) why it doesnt work
b) if there is a solution beyond rolling my own controls and writing a whole load of js
EDIT
ok its ASP.Net 2.0 and the 1.0 toolkit the page broadly looks like this (Note for the pedants i haven't closed tags, this is just to show the basic structure)
Main Page
Form
table
td
iFrame
! -- contained page --
Form
asp:ScriptManager
asp:UpdatePanel
asp:Repeater
I have been using some of my pages in IFrames using UpdatePanel, and they DO NOT produce any full page postbacks.
Can you describe the whole setup in more detail?
EDIT: Hmmm. The setup looks OK. Did you check whether the control which triggers the postback is placed inside the panel? Also, did you check for JS errors occuring before the ajax request fires?
Today I came across the same problem (trying to load gridviews asynchronously): A postback inside an iframe would reload the whole page, and ignore the postback event handler.
My solution was to use UFRAME.

Categories

Resources