PostBack Ritalin

PostBack Ritalin is an ASP.NET AJAX server control to help simplify the common task of disabling buttons during partial postbacks.

PostBack Ritalin depends on the ASP.NET AJAX extensions. If you’re using ASP.NET 3.5, you’re all set. If you’re using ASP.NET 2.0, make sure you have the AJAX extensions property installed and configured before attempting to use PostBack Ritalin.

Properties

PreloadWaitImages: Boolean value which controls preloading of WaitImages. Defaults to true.

WaitImage: String value specifying an alternate image URL to be displayed during partial postbacks. If this is not specified, ImageButtons will be functionally disabled, but visibly unchanged during partial postbacks.

WaitText: String value specifying replacement text for any Button controls, displayed only during partial postbacks (e.g. “Please Wait”, “Processing…”, etc). If omitted, defaults to “Processing…”.

MonitoredUpdatePanels: An optional collection of UpdatePanels to monitor. If specified, then only the specified UpdatePanels will activate PostBack Ritalin. If omitted, any UpdatePanel on the page will active PostBack Ritalin. See usage example and sample website for syntax.

MonitoredUpdatePanel Properties

DisableAllElements: If the DisableAllElements property of a MonitoredUpdatePanel is set to true, partial postbacks raised within that UpdatePanel will disable all of the Button, ImageButton, and LinkButton controls inside that UpdatePanel instead of just the one that triggered the partial postback.

UpdatePanelID: The control ID of the UpdatePanel to monitor.

WaitImage: Same functionality as the master WaitImage, but specific to the particular UpdatePanel specified by UpdatePanelID.

WaitText: Same functionality as the master WaitText, but specific to the particular UpdatePanel specified by UpdatePanelID.

Usage examples

Basic usage. In the following example, when Button1 is clicked, its text will be replaced with “Processing…”, it will be blurred, and it will be disabled. When the partial postback completes, it will revert to its previous state.

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
  <ContentTemplate>
    <asp:Button ID="Button1" runat="server" 
      Text="Click Me" OnClick="Button_OnClick" />
  </ContentTemplate>
</asp:UpdatePanel>
<encosia:PostBackRitalin runat="server" />

Example of using the MonitoredUpdatePanels collection to restrict PostBack Ritalin to only activate on events triggered from certain UpdatePanels. In the following example, only events from UpdatePanel1 will cause Button1 to be disabled during partial postbacks. Events occurring in UpdatePanel2 will be unaffected.

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
  <ContentTemplate>
    <asp:Button ID="Button1" runat="server" 
      Text="Click Me" OnClick="Button_OnClick" />
  </ContentTemplate>
</asp:UpdatePanel>
 
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
  <ContentTemplate>
    <asp:Button ID="Button2" runat="server" 
      Text="Click Me" OnClick="Button_OnClick" />
  </ContentTemplate>
</asp:UpdatePanel>
 
<encosia:PostBackRitalin ID="PostBackRitalin1" runat="server">
  <MonitoredUpdatePanels>
    <encosia:MonitoredUpdatePanel UpdatePanelID="UpdatePanel1" />
  </MonitoredUpdatePanels>
</encosia:PostBackRitalin>

Download

Download PostBack Ritalin

Changelog

v1.18 (1/28/2012)

  • Applied J S’ update to add tests for undefined when traversing the DOM.

v1.17 (9/3/2010)

  • Fixed issue with DisableAllElements in Master/Content pages.

v1.1 (4/12/2010)

  • Compatibility update for ASP.NET 4.

v1.0 (4/6/2009)

  • Added disable all elements functionality to MonitoredUpdatePanels.
  • Fixed a bug in the WaitImage preloading functionality, that prevented the MonitoredUpdatePanels’ WaitImages from being preloaded.
  • Added both debug and release versions of the JavaScript resource. Your site’s compilation mode will determine which script version is embedded.
  • Fixed a problem handling postbacks raised by Button controls that have their UseSubmitBehavior property set to false.
  • Improved ClientID handling in naming containers.

v0.10 (6/30/2008)

  • Complete rewrite of the JavaScript component of the control. Instead of global variables and functions, PostBack Ritalin is now a proper JavaScript prototype object. This significantly minimizes its namespace impact on the DOM.
  • JavaScript embed is now minified.
  • By popular demand, added support for disabling LinkButtons.
  • Added optional image pre-loading for WaitImages. Previously, disabled ImageButtons could take a bit too long to show their disabled image the first time, due to HTTP delay. Enabling pre-loading will cause the browser to pre-fetch and cache the disabled images, resulting in instant feedback for the disabled state.
  • Several bug fixes, based on your invaluable feedback.

v0.9 (1/30/2008)

  • Resolved all remaining issues with master pages. Nested naming containers should no longer cause any issues.
  • Added the ability to provide UpdatePanel specific WaitText and WaitImage properties for each MonitoredUpdatePanel.
  • Added correct handling for virtual paths in all WaitImage properties.
  • Added CSS to change cursor style to “wait” when hovering over the disabled control.
  • General improvements to client side code.

v0.8 (1/13/2008)

  • Removed Toolkit dependency (no more build mismatches!).
  • Added MonitoredUpdatePanels collection, to control which UpdatePanels events are handled for.
  • Potentially fixed master page issues.

v0.5

  • Updated build to target the latest Toolkit (11119).

v0.4

  • Updated build to target the latest Toolkit (10920).

v0.3

  • Updated build to target latest Toolkit (10618).

v0.2

  • Added WaitImageURL, to better support ImageButton controls that raise postbacks.
  • Added a check to ensure that the control raising the postback is either an ImageButton or Button type, to clear up some issues with submitting a form with enter while a Textbox is focused.
  • Added a check to make sure the control that raised the postback still exists after the postback completes, in case the newly updated div no longer contains that element (e.g. a form that transitions to a confirmation message)

v0.1

  • Initial release

3 Mentions Elsewhere

  1. Just a Geek and His Blog
  2. ASP.NET disable a button control during postback « Basketman's Blog
  3. Disable buttons when performing an Ajax.NET Postback « alanfeekery.com

149 Comments

Anonymous
5:04 pm - July 7, 2007

Thank you! I was able to follow the same line of reasoning that you described, except using the object model of the 3rd party control I am using.

Good stuff!!

Reply to this comment
1:06 pm - July 17, 2007

Why don’t you integrate this into the AJAX control toolkit? This is good concept and the masses should get this with a simple download of the AJAX control toolkit.

Reply to this comment
4:40 pm - July 17, 2007

I think I’m probably going to go the other way with it and make it standalone. The Toolkit dependency has caused me no end of headache.

Reply to this comment
10:01 am - September 7, 2007

Hi, it’s a great extender, but can you also support the linkButtons? I’d appreciate if I could also see the source code…

Reply to this comment
1:14 pm - September 7, 2007

I believe adding LinkButton support would be pretty easy. I’ll put that on my list of things to do.

Reply to this comment
11:15 am - September 14, 2007

For those of us not using Visual Studio, what does the Assembly registration look like for your control?

Reply to this comment
12:54 pm - September 14, 2007

Like so:

<%@ Register Assembly="PostbackRitalin" Namespace="Encosia" TagPrefix="cc1" %>
Reply to this comment
2:45 pm - September 14, 2007

Thanks. Worked like a charm.

Another question. Does the WaitImageURL property only apply for image buttons? The behavior I was expecting was for my button to be replaced by a waiting image.

Reply to this comment
3:27 pm - September 14, 2007

Yes, it only uses the image replacement if the control that raises a partial postback is an ImageButton control.

Reply to this comment
10:11 pm - September 16, 2007

Dave

This extender is great! But I think I might have found a bug. I’m trying to use it with an ImageButton, and it seems that the WaitImageURL property isn’t acting as intended. I debugged with FireBug and found this code:

_partialUpdateBeginRequest : function(sender, e)
{
$get(e._postBackElement.id).disabled = true;

if (e._postBackElement.type == “submit” && this._WaitTextValue != “”)
{
this._oldValue = $get(e._postBackElement.id).value;
$get(e._postBackElement.id).value = this._WaitTextValue;
}
else if (e._postBackElement.type == “image” && this._WaitImageURL != “”)
{
this._oldImageURL = $get(e._postBackElement.id).src;
$get(e._postBackElement.id).src = this._WaitImageURLValue;
}
}

Should that else if contain (e._postBackElement.type == “image” && this._WaitImageURLValue != “”) instead? this._WaitImageURL is undefined while this._WaitImageURLValue matches up with the WaitImageURL property.

Reply to this comment
1:04 am - September 17, 2007

You’re absolutely right. I have no idea how that slipped through the cracks. Thanks for pointing it out to me.

I just uploaded a corrected version.

Reply to this comment
6:15 am - September 17, 2007

Awesome, thanks!

Reply to this comment
12:11 am - January 13, 2008

Updated to version 0.8.

Massive changes this version, including removal of the Toolkit dependency and properly being able to target only certain UpdatePanels.

Give it a try and let me know what you think.

Reply to this comment
Chris Subscribed to followup comments
12:50 pm - January 28, 2008

Is that possible to use imagebutton within monitored update panel like:

I tried this but it’s not working. If I remove the monitoredupdatepanel, it works like a charm. Any idea?
Thanks,

Reply to this comment
1:01 pm - January 28, 2008

Try that again with <pre lang=”asp”></pre> around the code.

Reply to this comment
Chris Subscribed to followup comments
2:44 pm - January 28, 2008

My problem is that I have three update panels and I’d like to use a different image for each panels. So my idea was having three monitored update panel with different image in it. and I used the following code:

Reply to this comment
8:05 pm - January 30, 2008

Updated to version 0.9. The new version adds a couple new features and a couple bugfixes, thanks to Chris’ feedback. Thanks, Chris!

Reply to this comment
Mattias
7:50 pm - February 6, 2008

Support for LinkButtons would be great.

Reply to this comment
12:04 am - February 7, 2008

That shouldn’t be difficult. I’ll add it in the next build.

Reply to this comment
Robert Subscribed to followup comments
10:20 am - February 12, 2008

Hi,

args.get_postbackBackElement() can return null in which case asking for the type gives a null reference (using v0.9)

And so can sender._postBackSettings.sourceElement

Reply to this comment
7:24 pm - July 2, 2008

Thanks for the bug report, Robert. Those problems should both be fixed in v0.10

Reply to this comment
Roger
11:37 am - February 18, 2008

Excellent, works great right out of the box Thanks!

Reply to this comment
11:57 pm - March 1, 2008

Hi the ajax control toolkit is updated.
thanks for attention.

Reply to this comment
12:06 am - March 2, 2008

This isn’t dependent on the Toolkit anymore. The current download should work with any Toolkit version.

Reply to this comment
12:06 pm - March 5, 2008

Dave, any plans to release the source or add support for LinkButton. We use as many link buttons as regular ones. Thanks!

Reply to this comment
12:13 pm - March 5, 2008

LinkButtons are something I plan on handling, but I haven’t decided how best to do it. Since <a> elements don’t have a disabled property, it’s a bit more tricky than with regular buttons and image buttons.

Reply to this comment
Brian Minisi Subscribed to followup comments
4:39 pm - March 14, 2008

Dave, the control works fine, however, when in design view, the controls on the page do not render and an error is displayed. It reads, “Error Creating Control – Content1 ‘encosia:PostBackRitalin’ could not be set on property ‘MonitoredUpdatePanels’.

This isn’t a problem for me, but the designers on my team are complaining. Do you know what is causing this. This is within a master page. Thanks!

Reply to this comment
4:42 pm - March 14, 2008

I have to confess I rarely remember to test my controls in design view, because I never use it myself.

It’s probably something minor. I’ll take a look at it and get it fixed.

Reply to this comment
10:12 pm - March 17, 2008

I haven’t been able to reproduce this. Could you email me a representative site/project?

Reply to this comment
Luda Subscribed to followup comments
1:59 pm - April 1, 2008

Thanks, Dave.
I’m using your control on the page within the master page with only one UpdatePanel.
The control works fine when I use MonitoredUpdatePanels collection – but I’m getting the same error msg in the design view as Brian above (Error Creating Control – Content1 ‘encosia:PostBackRitalin’ could not be set on property ‘MonitoredUpdatePanels’).
When I use the control without MonitoredUpdatePanels collection (Basic usage) the control does not work.

Reply to this comment
2:13 pm - April 1, 2008

You can safely ignore that error. It doesn’t actually affect anything.

If you’d like a pre-release build that fixes that, send me an email that I can reply to with the attachment.

Reply to this comment
2:08 pm - March 19, 2008

Do you have any plans to implement “Sorting” on gridviews?

Example, I have a search form. Clicking the button triggers the event, but columns sorting does not trigger this to lock the button.

Do you have any instructions on how to do this or plans to implement this into the control?

Reply to this comment
11:32 pm - March 19, 2008

That should be possible when I add LinkButton disabling to it in the next build. It’s just a bit problematic to implement since I can’t disable <a> elements the same way as Buttons and ImageButtons.

Should be coming soon.

Reply to this comment
Joe
8:20 pm - March 30, 2008

Nice work so far.

I have a problem with the new CSS cursor changes in 0.9. On a button click, if the code being called in the button click event handler and an exception is thrown I would like the user to be able to click the button again (i.e. it returns to its original state). At the moment the text reverts and button becomes enabled, but the cursor does not change back to an arrow and remains an hourglass.

Long story short, is it possible to remove this change
Added CSS to change cursor style to “wait? when hovering over the disabled control.
or at least provide a way to disable it?

When is the next version to be released?

Reply to this comment
11:13 am - April 1, 2008

To be honest, I think that option was a lot better in theory than practice. It’s such a small area affected, the pointer change isn’t very useful anyway.

I’m going to remove that feature. I’m not quite ready to release the next build yet, but I’ll email you a version with that option removed later this afternoon.

Reply to this comment
Joe
1:38 am - April 28, 2008

I have noticed another issue. I have a set of navigation buttons to navigate through pages of an asp:MultiView. The next button is disabled on the last page, and the previous button is disabled on the first page. When the Postback Ritalin extender is applied, the enabled state is overriden with true. i.e. The next/previous buttons are always enabled after clicking on them once. Obviously, a workaround would be to put them in a separate update panel, but its not exactly elegant.

Reply to this comment
7:38 pm - April 28, 2008

Can you email me a representative sample? I’ll check it out.

Reply to this comment
Radoslav
11:08 am - June 9, 2008

Beautiful control, thank you!

One question… is there a way to set the Wait text in the codebehind? I need to change it programmatically as my website is localized so the text should be multilingual as well.

Thanks a lot!
Radoslav

Reply to this comment
4:12 pm - June 9, 2008

During the initial page load, you should be able to set it programmatically, as long as you do it before the PreRender event. Something like this:

protected void Page_Load(object sender, EventArgs e)
{
  if (!IsPostBack)
    PostBackRitalin1.WaitText = "Please wait...";
}
Reply to this comment
Anonymous
12:38 pm - June 20, 2008

I’ve encountered an error caused by the fact that you check for the existence of a control before checking to see if the panel is monitored. Specifically the line of code in the EndRequest handler, PBR_EndRequest(sender, args), and is

if ($get(sender._postBackSettings.sourceElement.id) != null && PBR_IsMonitoredRequest(sender._postBackSettings.panelID))

I have a GridView and when I add default pager controls, they are implemented as <input type=”image”….> having no ID. The $get method throws an exception because the ID defaults to “” and $get fails on this. The GridView is an update panel that is not monitored by PBR, so if the conditional components were switched I don’t think the error would occur. Better yet, make sure that ID is not empty and null before calling $get. Unfortunately without the code, I’m stuck and can’t use the control (which I really like) on the page.

Thanks,
Richard

Reply to this comment
1:12 pm - June 20, 2008

Take a look at the beta of the next version, and let me know if it fixes that for you. It includes more sanity checking for things like that.

Reply to this comment
Richard Subscribed to followup comments
2:04 pm - June 20, 2008

Thanks for your fast reply. Unfortunately, the lastest Beta generates an error from the following inserted script in the page.

var pbr = new PostBackRitalin('Processing...', null, ['FilterUpdatePanel'], {'FilterUpdatePanel' : 'Applying...'}, }, true);

Probably something I doing wrong, but my work-around (see following post) gets me through for the time being.

Thanks,
Richard

Reply to this comment
2:20 pm - June 20, 2008

That’s an unrelated error that I wasn’t aware of. I just fixed it and emailed you an updated DLL.

Give it a try, if you don’t mind.

Reply to this comment
Richard Subscribed to followup comments
1:41 pm - June 20, 2008

Added information: The controls used in the Pager row for a GridView are ImageButton controls (that was mangled in the previous post).

Here’s a work-around: I handled the RowCreated event for the GridView and added an ID for the ImageButton controls and that solved the problem. This of course has the added benefit that I could use I suppose PBR on these controls. Here’s the RowCreated event handler.

protected void SurveyTable_RowCreated(object sender, GridViewRowEventArgs eventArgs)
{
    GridViewRow row = eventArgs.Row;
    if (row.RowType == DataControlRowType.Pager)
    {
        // The pager row is rendered as a table with a  single row and cells for each of the images. 
        // The rather weird specification of the controls ControlCollection is to just get down to
        // the list of <TD> in the table.
        ControlCollection controls = row.Controls[0].Controls[0].Controls[0].Controls;
        foreach (Control control in controls)
        {
            ImageButton image = control.Controls[0] as ImageButton;
            image.ID = image.AlternateText; 
        }
    }
}
Reply to this comment
11:17 am - July 7, 2008

Thanks again for this excellent work! One question – is it possible to disable all buttons in an UpdatePanel instead of just the one that initiated the partial postback?

Reply to this comment
11:26 am - July 7, 2008

Not yet, but almost certainly in the next release.

Reply to this comment
Duane
11:30 am - July 18, 2008

I have a couple of different validation groups, and the postback stuff works as I expect except the Page Validation is alwasys false..

Any idea how to track this down?

Reply to this comment
Duane
11:37 am - July 18, 2008

UPDATE: It actually causes validation issues when I’m monitoring one specific update panel .. If I just have the control on the page, it runs fine.

Reply to this comment
7:03 pm - August 15, 2008

I have no idea what would cause that. I’ll add it to my test cases and try to track it down in the next release.

Reply to this comment
Dave Neeley Subscribed to followup comments
6:40 pm - August 15, 2008

So this is a fun one. If you set the UseSubmitBehavior=”false” on the button that caused the postback, PostBackRitalin won’t run. Is there any way to get around that?

I found this out because of the Firefox+UpdatePanel+asp:Panel defaultButton problem described here.

Reply to this comment
7:02 pm - August 15, 2008

Thanks for the bug report.

I emailed you a potential fix. Let me know if that clears it up.

Reply to this comment
Dave Neeley Subscribed to followup comments
7:44 pm - August 18, 2008

The fix you emailed corrects the issueJust tested it. Thanks, and kudos on your extremely speedy response! ;)

Reply to this comment
JasonR
3:49 am - September 5, 2008

Hmm. I can put this in an empty .aspx file and it works fine. Copy and paste the same code into my project’s .aspx and it doesn’t do anything (no buttons are grayed out and the button’s text doesn’t change). I tried putting it in multiple places in the code and using multiple buttons and none of them have any effect. Odd, but I don’t have time to look into it. I don’t use UseSubmitBehavior=”false”, so whatever is wrong seems to not be mentioned on this page thus far. Can’t give out my code (and it’s too long anyway), so I guess nothing can be done.

Reply to this comment
6:39 am - September 5, 2008

I’m assuming your existing project’s ASPX is properly ASP.NET AJAX enabled in the web.config and has a ScriptManager on the page?

Does placing it on the page and/or submitting a partial postback with it present cause any JavaScript errors?

Reply to this comment
JasonR
4:37 pm - September 5, 2008

Okay, it bothers me when I give up on something, so I decided to work this out. I think the copy/paste sample code wasn’t working on my .aspx because I had an unrelated postback that had an error in it. Once I fixed that, the sample update panel and button worked, but my login button still does not. I use code like this to handle asynchronous login (http://disturbedbuddha.wordpress.com/2007/11/19/a-client-side-ajax-login-for-aspnet/). I tested with the manual javascript simpler version where I believe your postback ritalin started from in your early blog posts (http://encosia.com/2007/01/16/css-style-as-ajax-progress-indicator/) and I debugged to find that $get(sender._postBackSettings.sourceElement.id) was the id of the update panel and not the button. I think this is because the button does not directly cause the postback and the postback must happen after the login is completed as seen on the disturbedbuddha link. It seems like a bad idea to postback twice, so I don’t see any way to tie this button click into PostBackRitalin. I can manually disable and enable the sign in button since I already have start/end functions but it would be nice to tie it into the rest of the postback callers. Maybe you could add a property to manually add Ids which are to be disabled by PostBackRitalin. I haven’t thought that through much, I’m sure you’ll have a better picture. Maybe a future version which you mentioned somewhere should support multiple button Ids in the same updatePanel being disabled will automatically support this.

Reply to this comment
6:19 pm - September 5, 2008

You’re on the right track there.

The reason that my control isn’t working for that button is because it doesn’t generate a partial postback at all. That authentication example makes a web service call to log the user in, not a partial postback.

As an aside, I would advise against following that example too closely. Hiding secure content from anonymous users with client side functionality is a good way to end up on The Daily WTF.

Reply to this comment
JasonR
7:28 pm - September 5, 2008

Well I do have a partial postback to load the logged in interface; it just isn’t done until after the login call completes. I don’t follow what you mean about hiding secure content from anonymous users with client side functionality. Its just a web application that never does a full postback currently (except when logging out). From the user’s perspective it looks exactly the same as any other website with login functionality; it just stays at the same web address and never redraws the screen from scratch because it is important for a seamless visual experience on my site to never have a full postback.

Reply to this comment
7:41 pm - September 5, 2008

I suppose my question then would be: why use two requests? If you’re going to load an interface with a partial postback anyway, wouldn’t it make more sense to authenticate the user in that same request?

Re: security, if you look at that example you linked, he’s just hiding the secure content using CSS. A “view source” is all it would take for someone to access his “secure” content. It sounds like you (thankfully) aren’t using that part of his example, so you can disregard that problem.

Reply to this comment
Stephan
8:29 am - September 17, 2008

Hi, I see you have skillfully avoided the answer before, but here it is again: Any chance of getting hold of the source code?

Reply to this comment
7:30 am - September 18, 2008

Not generally, but get in touch with me privately with the details of what you need it for and we might be able to work something out.

Reply to this comment
Eric Subscribed to followup comments
8:33 am - October 1, 2008

Dave

I’m using asp.net 2.0, along with the AJAX extensions. I downloaded PostBackRitalin (both the dll and pdb files ) and put them in the /bin directory of my project. I added the “using Encosia” to my code-behind cs file, and added the register assembly reference to my aspx file. I can see the classes in the code behind, however I cannot seem to make reference to encosia in the aspx file. When I try and run the file I get the error: Unknown server tag ‘encosia:PostBackRitalin’. Could you provide some instruction as to how I can integrate this with my project ?

Cheers

Eric

Reply to this comment
9:50 am - October 1, 2008

You shouldn’t need the “using” in code-behind. Make sure your registration on the ASPX page is like this:

<%@ Register Assembly="PostbackRitalin" Namespace="Encosia" TagPrefix="encosia" %>

If your project is a web application project, you’ll need to add a reference to the DLL as well. Just placing it in the /bin directory doesn’t take care of that automatically unless it’s a website project.

Reply to this comment
Rajiv
2:16 pm - November 18, 2008

Thanks for the control.

Reply to this comment
10:43 am - November 21, 2008

Is there anything special you have to do for it to work with LinkButtons?

It seems to work fine for normal buttons, but it’s not working for me on LinkButtons.

Nice control, btw-

Thanks-

Reply to this comment
11:19 am - November 21, 2008

After some digging with Reflector I noticed for LinkButtons in the _beginRequest method that you aren’t disabling the element or changing the text or anything except removing the href.

Is that intentional? I realize you are achieving the desired goal – but there’s no visual feedback that the link isn’t clickable.

Couldn’t we at least just disable the element? Or maybe even change the text?

Thanks-

Reply to this comment
11:43 am - November 21, 2008

Unfortunately, there’s no way to “disable” an <a> element in the browser. That’s the reason for the kludgey href shell game.

Next version, I’ll probably add an option to manipulate the link’s CSS during the postback.

Reply to this comment
Chris Subscribed to followup comments
9:41 am - December 30, 2008

Dave,
This control is fantastic. Question: I have a basic page with nothing but one update panel, two buttons in the panel and your control. Only the button that initiated the postback is disabled. I saw in a previous comment that you were going to add multiple buttons. Have you done this and I am just not configuring your control correctly? Thanks again for supplying a simple (from my end anyway) solution to a problem everybody has.

Chris

Reply to this comment
7:49 pm - January 2, 2009

Hi, Chris.

I’ve actually been working on that functionality this week. I’ll email you a release candidate as soon as it’s available, if you’d like to get early access to it and help me test it.

Reply to this comment
Helen
8:25 pm - January 18, 2009

Hi,Dave

The control works excellent. It solves us double click issue in Ajax. But, we have multi buttons and links on one page. It only disabled the button we clicked. Any possible to put a div cover on top of page to avoid user to click other buttons , links ,etc when they wait?

Cheers
Helen

Reply to this comment
9:42 am - January 19, 2009

In the next version (almost finished; at RC now), it will allow you to disable all Buttons, LinkButtons, and ImageButtons in the UpdatePanel that triggered an update, instead of just the control that raised the postback.

For a more comprehensive, full-screen effect like you’re describing, check out this post about using BlockUI to implement that: http://encosia.com/2008/10/04/using-jquery-to-enhance-aspnet-ajax-progress-indication/

Reply to this comment
prakash Subscribed to followup comments
9:20 am - February 27, 2009

when are u planning to release this version… as stated below

Dave Ward 9:42 am – January 19, 2009In the next version (almost finished; at RC now), it will allow you to disable all Buttons, LinkButtons, and ImageButtons in the UpdatePanel that triggered an update, instead of just the control that raised the postback.

Reply to this comment
3:21 pm - February 28, 2009

There’s an issue of ClientIDs when it’s used on a Master Page, which is why I haven’t released it yet.

If that isn’t a concern for your application, you can get the 1.0 RC here: http://encosia.com/controls/postbackritalin/postback-ritalin-1.0-rc1.zip

Reply to this comment
Olga LEDNICHENKO Subscribed to followup comments
3:28 pm - March 10, 2009

Hi,

I have been reading your blog for a long time.. I tried, for the first time to download.. But I couldnt find the source code.. only the dll is included in the downloads..

did i miss something?

please let me know

thanks
olga lednichenko
——————————
the one that got scammed

Reply to this comment
Ben
8:01 pm - March 19, 2009

The assembly in the download file has not been signed with strong key,can I disassemble it and recompile it with a strong key and use it?

Reply to this comment
8:03 pm - March 19, 2009

Definitely, feel free. I’d just ask that you don’t redistribute it.

Reply to this comment
Ben
3:27 pm - March 22, 2009

Cool,thanks.

Reply to this comment
Nigwoko Subscribed to followup comments
7:59 am - June 1, 2009

Is this free for commercial use ?

Reply to this comment
9:59 am - June 1, 2009

Yes.

Reply to this comment
Nigwoko Subscribed to followup comments
11:45 am - June 1, 2009

Great! Thanks.

Reply to this comment
Julien
3:59 pm - June 3, 2009

Hi,

First of all thanks for you work.

In my web app, I use the TabContainer from the Ajax Control Toolkit. The TabContainer is inside an UpdatePanel because I also have a ASP.NET Wizard to switch TabPanel. The user also has the possibility to witch TapPanel by clicking on the TabPanel Header.

I wonder if it is possible to use PostBack Ritalin to prevent users from clicking too fast between the TapPanel Headers, which makes crash the TabContainer with this error:

Error: [Exception… “‘Sys.ArgumentOutOfRangeException: Sys.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: value’ when calling method: [nsIDOMEventListener::handleEvent]” nsresult: “0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)” location: “” data: no]

I added your control in my code but it only have an effect on the Wizard Next/Previous button.

Thank you.

Reply to this comment
Julien
4:00 pm - June 3, 2009

By the way, the AutoPostBack property of my TabContainer is set to True so I can manage Wizard current step when the user switches TabPanel by clicking on the TabPanel header.

Reply to this comment
Steve
4:38 am - July 28, 2009

Just the job…. cracking control !

thanks

Reply to this comment
Rohit
12:20 pm - July 31, 2009

This is nice. Can I post an online article on this?

Reply to this comment
2:25 pm - July 31, 2009

Sure.

Reply to this comment
mooka
7:10 pm - August 9, 2009

Anyone ever get the error pbr_oldtext is undefined when using this control? This occassionally happens and causes partial postbacks to change to full postbacks.

Reply to this comment
7:16 pm - August 9, 2009

Updating to v0.10 or v1.0 should fix that, I believe.

Reply to this comment
Fabian Hoyos
3:08 pm - September 21, 2009

Hi Dave.
This control just saved my day.
Thanks for sharing it, it’s a really good job.

Reply to this comment
12:07 am - October 14, 2009

Thank you so much for this. I have had Firefox customers getting double charged for some time now because the script to disable the button caused two postbacks. Now I won’t get double orders from anyone and we are all happy!

Reply to this comment
Pragnesh Subscribed to followup comments
6:47 am - November 3, 2009

hi Dave,
thanks for nice extender.
but i am not able to use it.
i am using master page & my update panel updates on click of checkbox.
Please can you suggest where am i wrong?

Reply to this comment
1:00 pm - November 3, 2009

That should be okay if you use the DisableAllElements feature added in v1.0. If your checkbox that triggers the UpdatePanel is in UpdatePanel1, something like this:

<encosia:PostBackRitalin runat="server">
  <MonitoredUpdatePanels>
    <encosia:MonitoredUpdatePanel UpdatePanelID="UpdatePanel1" DisableAllElements="true" />
  </MonitoredUpdatePanels>
</encosia:PostBackRitalin>
Reply to this comment
Jonah Kunz
5:20 pm - April 16, 2010

Thanks a ton… this was making me insane having 2 buttons and an image to manipulate in javascript

Reply to this comment
Jan Subscribed to followup comments
8:24 am - July 7, 2010

Any chance of maybe checking checkboxes with this great control?
That would realy help me a lot

Reply to this comment
11:31 am - July 7, 2010

It could be expanded to affect checkboxes without too much trouble.

Would you need it to change the checkboxes’ labels at all, or just make them unclickable during the postback?

Reply to this comment
Jan Subscribed to followup comments
1:22 am - July 8, 2010

Just making them unclickable would be more than enough, dont need their tect to change.

Reply to this comment
Martin
8:57 am - November 11, 2010

Great stuff!

I hope that the checkboxes are included soon, I would appreciate it a lot!

grtz
Martin

Reply to this comment
Kaschan Subscribed to followup comments
4:09 am - July 13, 2010

Hi Dave,

Your work is great.

I would like to set 4 buttons in same UpdatePanel to be disabled when users click 1 of them. I set the DisableAllElement to be True. But only clicked button is disabled.

Please help me.

Reply to this comment
Matt Subscribed to followup comments
10:34 am - August 26, 2010

I am having problems getting this to work. I get a compiler error: ‘Button_OnClick’ is not a member of ‘ASP.default_aspx’.

Is there any chance you could provide a download of a sample project with a single button in it?

Reply to this comment
6:36 am - November 14, 2010

Could you re-write Postback Ritalin without AjaxControlToolkit dependency?

Reply to this comment
11:26 am - November 14, 2010

As long as you’re using v0.8 or higher, the AjaxControlToolkit dependency is no longer present. I rewrote it as a standard server control at that point, instead of continuing it as an ACT Extender Control.

Reply to this comment
5:49 am - December 22, 2010

Silly of me not to first upgrade the version.
By the way PostBackRitalin is really wonderful!

Reply to this comment
J S Subscribed to followup comments
3:38 pm - December 8, 2010

FYI, PostBackRitalin._findContainingPanel line ~58:

_findContainingPanel: function (el) {
// If the element is null, we’re at the top of the DOM and haven’t found it.
if (el === null || this._monitoredUpdatePanels === null)

when el is undefined, el === null is false although el == null is true. this causes the following error since the function continues with invalid parameters:

Message: ‘id’ is null or not an object
Line: 61
Char: 5

Reply to this comment
ales Subscribed to followup comments
8:13 am - January 24, 2012

Hello. Can you fix this issue, please. I have the same problem. I would appreciate it a lot. Thanks.

Reply to this comment
J S Subscribed to followup comments
4:28 pm - January 24, 2012

FYI, I just worked around this issue by making sure the code didn’t run when the element being referenced wasn’t defined. You might be able to accomplish this by setting style: display = none client-side instead of toggling a control’s Visible property.

Reply to this comment
5:21 pm - January 24, 2012

For some reason, I thought I had fixed that. Can you confirm that it’s still an issue in the latest build? If it’s still not handling that right, would one of you mind filing an issue here? https://github.com/Encosia/PostBackRitalin/issues. I’ll get it fixed.

Reply to this comment
George
10:21 am - December 9, 2010

Thank you for the control, was going to tear my head out. Still I think I found a bug.

If you click the button at the start and the click the Update Panel Buttons the postback ritalin functionality is lost. I am thinking maybe it is not registering well on a full page postback.

 
 
 
 
 
 
 
 
    Untitled Page

Also I am having the same problem as Kaschan where I set it to true and not all buttons are disabled. THat example is more complicated as there are many UpdatePanels and this one is inside another panel used by the ModalPopupExtender.

Reply to this comment
George
10:22 am - December 9, 2010

Sorry I wrote the code wrong it seems. A preview button would be nice.

Untitled Page

Reply to this comment
StronglyTyped Subscribed to followup comments
2:14 pm - January 27, 2011

Thanks for posting this. Is it possible to wire up the WaitingText to a LinkButton?

Reply to this comment
3:26 pm - January 27, 2011

Not currently. I didn’t implement that because it would need to be conditional. You wouldn’t want the link text changing for LinkButtons in a GridView pager, for example.

I’ll put that on the list for the next version though.

Reply to this comment
StronglyTyped Subscribed to followup comments
8:20 am - January 28, 2011

Good point. Thanks for considering adding this!

Reply to this comment
Rui Belchior Subscribed to followup comments
9:34 am - April 8, 2011

Hello Dave,

Nice control you have here!

Is there a way of applying the DisableAllElements property to all the UpdatePanels instead of having to define specific ones?
It would be like having this property at the PostBackRitalin level instead of just the MonitoredUpdatePanel.
If not, can’t this be implemented?

Best Regards,
Rui Belchior

Reply to this comment
12:32 am - May 19, 2011

Hi Dave,

I know that my request comes from the depth of my laziness. :)
But still, if you could possibly add PostBackRitalin.dll to NuGet, it would be great!

Regards,
Naveen Jose

Reply to this comment
Eric St.Clair Subscribed to followup comments
3:10 pm - June 13, 2011

Hi Dave,

This is just the extender I have been looking for.

I have a page with 3 buttons in 1 update panel. I have set the DisableAllElement property to True, but only the button clicked is being disabled.

Your help would be much appreciated.

Thanks,

Eric St.Clair

Reply to this comment
5:55 pm - June 13, 2011

Are you seeing any JavaScript errors throw just after clicking the button? Can you email me a sample that reproduces the problem?

Reply to this comment
Thiago Subscribed to followup comments
12:04 am - July 6, 2011

Hi Dave. I`m having a problem on my aspx page.

The control works fine if a just press continue on IE alert after the error occurs.
Take a look at that:

Microsoft JScript: Sys.ArgumentException: Value must not be null for Controls and Behaviors.
Parameter name: element

Do you have any idea of what is going on?
I have a master page with ajaxcontroltoolkit and updatepagen, two content place holder (one inside the updatepanel) and other outside that. The encosia tag is right under the close tag of the updatepanel.

Reply to this comment
10:41 am - July 11, 2011

Make sure you’re using the latest version of the control (1.17). It fixes a problem with Master pages.

If that doesn’t help, can you send me a sample project that reproduces the error or point me at a page that I can look at in Firebug?

Reply to this comment
Thiago Subscribed to followup comments
10:11 am - July 16, 2011

Dave, i`m using the latest version!

I really don`t know what should i do to avoid this message.

Reply to this comment
3:25 pm - July 17, 2011

Can you send me an example that reproduces the error, or is this running somewhere that I can access it to debug in Firebug?

Reply to this comment
Scott Elliott Subscribed to followup comments
5:49 pm - July 14, 2011

Dave,

I know this is an old post, but I’m just now coming to it and had a thought that I didn’t see or must have missed in the comments.

DisableAllElements is sort of misleading to me when it only disables the buttons. I’d like it to actually do as it reads, disable all inputs whether they were text, button, submit, radio, etc.

Would this be possible?

Reply to this comment
8:26 pm - July 14, 2011

Hi Scott,

DisableAllElements does disable links, image buttons, and checkboxes.

What it doesn’t do is use WaitText or WaitImage to indicate that disabled state. For example, you wouldn’t want all of the paging LinkButtons on a GridView to change from “1, 2, 3, 4″ to “Processing…, Processing…, Processing…, Processing”. Same with WaitImages, since it’s not likely that a single WaitImage would always apply to every input[type=image] within a given panel.

The exception is that LinkButtons do all have the WaitClass applied to them during DisableAllElements, since that’s usually safe to apply to any LinkButton without changing its size/content.

Reply to this comment
frazzeled newbie Subscribed to followup comments
6:50 pm - August 18, 2011

My problem is that a ‘LinkButton’ no longer works. It works outside the UpdatePanel, but not inside the panel. I’m guessing that the date min/max doesn’t work for the same reason.

So, within the one .aspx page here is the general outline for the design:

Content
UpdatePanel
ContentTemplate
FormView
EditItemTemplate
note: all templates contain controls pertinent to that template (e.g. editable fields)
InsertItemTemplate
ItemTemplate (this is where the LinkButton is located)
EmptyDataItemTemplate
/FormView
/ContentTemplate
/UpdatePanel
select, delete, insert stuff follows here
/Content

Reply to this comment
Herman Becking Subscribed to followup comments
8:17 am - December 28, 2011

Thank’s Dave.

Reply to this comment
ales Subscribed to followup comments
6:28 am - February 6, 2012

Big thanks for update! :)

Reply to this comment
Tina Subscribed to followup comments
11:02 am - March 16, 2012

I get a security exception when trying to use this DLL. It’s registered to the app, I’ve unblocked the DLL file itself, I’ve set the Trust level in the web.config to “full,” but I still get this error:

[SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Reflection.Assembly._GetType(String name, Boolean throwOnError, Boolean ignoreCase) +0
System.Web.UI.NamespaceTagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs, Boolean throwOnError) +209
System.Web.UI.TagPrefixTagNameToTypeMapper.System.Web.UI.ITagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs) +210
System.Web.UI.MainTagNameToTypeMapper.GetControlType2(String tagName, IDictionary attribs, Boolean fAllowHtmlTags) +242
System.Web.UI.MainTagNameToTypeMapper.GetControlType(String tagName, IDictionary attribs, Boolean fAllowHtmlTags) +17
System.Web.UI.RootBuilder.GetChildControlType(String tagName, IDictionary attribs) +22
System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty) +119
System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText) +605
System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) +1334

Reply to this comment
4:33 am - July 2, 2012

Hi, thanks for a great product but i think i have found a bug it does not convert UpdatePanelID to a ClientID so when the javascript tries to verify the panel ID it fails to do so!

Reply to this comment
4:44 am - July 2, 2012

It also seems to fail to disable Select items when it works!

Reply to this comment
6:30 pm - July 3, 2012

That shouldn’t matter. It searches for a substring match, so ctl00_ctl01_UpdatePanel1 matches a target panel ID of UpdatePanel1 for example.

Reply to this comment
4:50 am - July 2, 2012

One more bugged senario,
Lets say 2 have 2x usercontols both need this functionality

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:Label ID="label1" runat="server" Text="1" />
        <asp:Button ID="button1" runat="server" Text="ClickMe!" />
    </ContentTemplate>
</asp:UpdatePanel>
<encosia:PostBackRitalin Id="PostBackRitalin1" runat="server">
    <MonitoredUpdatePanels>
        <encosia:MonitoredUpdatePanel UpdatePanelID="UpdatePanel1" DisableAllElements="true" />
    </MonitoredUpdatePanels>
</encosia:PostBackRitalin>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
    <ContentTemplate>
        <asp:Label ID="label2" runat="server" Text="1" />
        <asp:Button ID="button2" runat="server" Text="ClickMe!" />
    </ContentTemplate>
</asp:UpdatePanel>
<encosia:PostBackRitalin Id="PostBackRitalin2" runat="server">
    <MonitoredUpdatePanels>
        <encosia:MonitoredUpdatePanel UpdatePanelID="UpdatePanel2" DisableAllElements="true" />
    </MonitoredUpdatePanels>
</encosia:PostBackRitalin>
    <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" ScriptMode="Release" CombineScripts="true" />
    <uc1:WebUserControl1 ID="WebUserControl11" runat="server" />
    <uc2:WebUserControl2 ID="WebUserControl21" runat="server" />

No only the first placed usercontrol gets the desired behavior!

Reply to this comment
6:32 pm - July 3, 2012

Could you email me a simple project that reproduces the error you’re seeing? I’ll take a look at it.

Reply to this comment
Enzo Subscribed to followup comments
5:21 am - July 3, 2012

Hi,
should I register the PostBackRitalin.dll in the GAC for use in Visual Studio?
Thanks
Enzo

Reply to this comment
6:31 pm - July 3, 2012

You could do that if you want, but it’s not necessary. If you add a reference to the DLL from your project in Visual Studio, that’s enough.

Reply to this comment
Steve Fortner Subscribed to followup comments
1:07 pm - August 7, 2012

Hey Dave, just rolled this out to fix an issue with a previous javascript implementation to disable buttons that double posted in Firefox and this worked great. No issues at all. Thanks!

Reply to this comment
Chris Wilson Subscribed to followup comments
7:49 am - January 21, 2013

Hi Dave,
Have been using this tool for a while and I love it. I have an issue with it at the moment, maybe you can shed some light on this; I am using the file upload control in an update panel, which I know is an issue.. to solve this I had to add the following to my submit button:

Now, the submit button no longer gets disabled by postback rittalin when I submit the form… why is this?
Thanks,
Chris

Reply to this comment
Dale Subscribed to followup comments
5:34 pm - March 10, 2013

Hi Dave,

I upgrade my PBR from 0.10 to 1.18 in our project but unfortunately when I build it, I keep getting “Assembly generation failed — Referenced assembly ‘PostBackRitalin’ does not have a strong name error.

Did I miss something? I did not change anything in the code, so far. By the way, I’m currently using .NET 4.5 in my VS2012.

Thank you and hoping your reply soon.

Thanks,
Dale

Reply to this comment
4:42 pm - March 18, 2013

Hi Dale,

I’ve never compiled any builds of the PBR assembly with a strong name. Is it possible that your old copy of 0.10 had this process applied to it, and you need to do that again for the new assembly?

Reply to this comment
Dale Subscribed to followup comments
5:38 pm - March 10, 2013

In addition, I re-signed the assembly (*.pfx) in my web project, which I thought is the culprit but still it won’t work.

Thanks,
Dale

Reply to this comment
Selden Subscribed to followup comments
4:54 pm - May 7, 2013

I have a web project that uses postbackritalin v 1.18.0.0. It works one one page, but not on another. Both pages use the same master page. I’ve even copied and pasted the controls from the working page to the non-working page. I’m using PBR to change the image for an imagebutton during postback. Any ideas about why this might happen? How I can troubleshoot? Thanks!

Reply to this comment
Selden Subscribed to followup comments
7:27 pm - May 8, 2013

Figured out my own problem! In case anyone else has a similar problem, it turns out I had TWO PBR on one page. One was in one of the master pages, and the other was in one of the pages that used that master page. Once I changed to a master page without PBR, the second was started working. So just make sure you have only ONE PBR!

Reply to this comment
Tobi Subscribed to followup comments
5:05 am - June 6, 2013

I’m implementing the control on .Net 2.0 and i have registered it and referenced the DLL in the bin. However, i still seem to be getting and Object Reference error

[NullReferenceException: Object reference not set to an instance of an object.]
Encosia.PostBackRitalin.OnPreRender(EventArgs e) in D:\Desktop\PostBackRitalin\PostBackRitalin\PostBackRitalin.cs:72
System.Web.UI.Control.PreRenderRecursiveInternal() +91
System.Web.UI.Control.PreRenderRecursiveInternal() +180
System.Web.UI.Control.PreRenderRecursiveInternal() +180
System.Web.UI.Control.PreRenderRecursiveInternal() +180
System.Web.UI.Control.PreRenderRecursiveInternal() +180
System.Web.UI.Control.PreRenderRecursiveInternal() +180
System.Web.UI.Control.PreRenderRecursiveInternal() +180
System.Web.UI.Control.PreRenderRecursiveInternal() +180
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3870

Please help

Reply to this comment
12:40 pm - June 6, 2013

In the latest version, this is line 72:

if (!Page.IsPostBack && ScriptManager.GetCurrent(Page).EnablePartialRendering)

So, my first suggestion would be to make sure there’s a ScriptManager on the page.

Reply to this comment
Tobi Subscribed to followup comments
1:07 pm - June 6, 2013

Hello Dave,
Thank you so much for responding. There is a script manager on the master page of the page.

Reply to this comment
Selden McCabe Subscribed to followup comments
11:48 am - July 11, 2013

The latest version of PBR does not seem to be working with the Visual Studio 2013 preview. I submitted a bug to MS about this, but I wonder if perhaps a change is needed to PBR to work with VS2013? Here’s my report to MS: http://connect.microsoft.com/VisualStudio/feedback/details/792485/postbackritalin-not-recognized

Reply to this comment
11:28 pm - July 14, 2013

Thanks for the bug report, Selden.

That’s a strange one. I’m able to reproduce the warning here in my VS2013 too, but it doesn’t seem to interfere with compilation or proper operation on the rendered ASPX page. Are you seeing something more serious?

I just tried doing a Build -> Clean Solution, followed by a Rebuild Solution, and that seems to have cleared the error up. Give that a try if you haven’t.

Reply to this comment
John Dee Subscribed to followup comments
6:50 pm - August 29, 2013

//resent 749pm 2013-08-29//
Dave Ward…I am runing .net 3.5 in VWD express 2008. I made a sample (simple asp.net) page with two updatepanels and the basic setup with postbackritalin1…This works GREAT and I appreciate your work with this fine tool.
However, when I “copy” the markup into my “real” web-project that uses MASTER-PAGE , the button gets disabled and the caption changes correctly, but the UpdateProgress control is NOT working as in the simple asp.net page. The following is on my “login” page which the content for a master-page (Master-Page does NOT have an UpdatePanel on it). Tthe UpdatePanel is on the “child-page” with these setup items:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Login01.aspx.vb" 
   Inherits="Login01" Title="Member's Login" MasterPageFile="~/Main01.master" %>
<%@ MasterType virtualpath="~/Main01.master" %>
<%@ Register Assembly="PostbackRitalin" Namespace="Encosia" TagPrefix="encosia" %>
 
   <asp:Content ID="Content2" ContentPlaceHolderID="CPH1" Runat="Server">
   <asp:ScriptManager ID="ScriptManager1" runat="server">
   </asp:ScriptManager>
   <asp:UpdatePanel ID="UpdatePanel1" runat="server">
   <ContentTemplate>
... page layout omitted...
... however...the page layout contains a <asp:Login -control.
... page layout omitted...
    </ContentTemplate>
    </asp:UpdatePanel>
  <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
      <ProgressTemplate>
         <div id="App_WaitBackground">
            <asp:Panel runat="Server" ID="pnlPopUpscreen" CssClass="App_WaitImage">
               <img style="margin-top: .4em;" src="Images\App_Wait.gif" alt="Processing...">
               <br />
               Processing...</asp:Panel>
         </div>
      </ProgressTemplate>
  </asp:UpdateProgress>

///
The App_WaitImage-CSS has z-index: 1000; the App_WaitBackground-CSS has z-index: 999;
So my question is…can you provide an example of where to place the markup for a Master-Page website application?

Thanks in advance…John Dee.

Reply to this comment
1:59 pm - September 22, 2013

I don’t think it matters where you place the markup for my control. I always put it below the UpdatePanel it applied to, as a matter of personal preference.

Can you be more specific about what you mean when you say the UpdateProgress control isn’t working? To my knowledge, there shouldn’t be any interaction between my control and that one, other than both of them adding client-side event handlers to the same PageRequestManager events.

Reply to this comment
John Dee Subscribed to followup comments
10:31 am - September 23, 2013

Thanks for the reply.
Not working means the wait-image does not appear, and does not become hidden.

It appears that since the LOGIN-control’s submit button did not have a click-event to the server, the progress-wait did not fire.

Once I added a button_click-event for the login-control button, all is working OK.

Sorry for your troubles.
Thanks very much, and no need to reply…
Thanks…John Dee

Reply to this comment
Ray Causey Subscribed to followup comments
4:23 pm - September 19, 2013

When using the WaitImage property on the MonitoredUpdatePanel, is there a way to specify alternate images based on specific criteria like button size (small or large). If I specify an image that looks good for a small control (icon), it doesn’t look when shown in a larger button control or one formatted with different dimensions (square vs rectangle).

<MonitoredUpdatePanels>
        <encosia:MonitoredUpdatePanel UpdatePanelID="UpdatePanel1"
            DisableAllElements="true"
            WaitImage="/Images/anim_loading.gif" 
            WaitText="Working..." />
    </MonitoredUpdatePanels>

Thanks
Ray

Reply to this comment
1:32 pm - September 22, 2013

There isn’t currently support for that. It would be a good feature to add though. Maybe as an optional data- attribute on each ImageButton element that would supersede the WaitImage property for that individual button if present?

Reply to this comment
Ray Causey Subscribed to followup comments
10:58 am - September 23, 2013

Dave,
Thanks for you reply,
Yes, I think adding a local WaitImage attribute at the ImageButton level could act as a override for a default defined elsewhere.

The only option I can think for achieving this is to switch the control back to a regular HTML image and use a OnClick attribute to change the image and call whatever function is required.

Do you have any other suggestions? for instance is there a way to nest the MonitoredUpdatePanel properties so the closest scope wins?
Thanks again
Ray

Reply to this comment

Leave a Reply

Basic HTML is allowed (e.g. <a>, <blockquote>, <strong>, <em>, etc).

To post formatted code blocks, use <pre lang="x">code</pre>, where x is asp, csharp, html, javascript, or xml.

s