Question

Using the BlockUI JQuery plugin I find strange behaviour from within an ASP.Net page.

I've implemented one of the BlockUI plugin demos (you can try out the original here - http://malsup.com/jquery/block/#dialog ) within an ASP.Net page.

When I serve this page from Visual Studio (MVWD 2010 Express) the 'Would you like to continue' dialog appears as it should but then (rather than waiting for me to press a button) just disappears after 1 to 2 seconds.

Can anyone explain why this might be ? The HTML rendered by the ASP.Net is visible at http://pastie.org/1057741 (lines 139-165 are the main bit).

Would appreciate any suggestions.

Was it helpful?

Solution

Well thanks to the folks on the 'Using JQuery plugins' forum (http://forum.jquery.com/using-jquery-plugins) this has been resolved.

The 'type' attribute of the input element with value 'Show Dialog' was 'Submit' which was causing a postback.

<input id="test" type="submit" value="Show Dialog" />

There were two ways to fix this:

  1. Change 'type' to 'button' or ...
  2. Put 'return false' within the two JS functions

FWIW I also amended my original example code (shown at http://pastie.org/1057741) to deal with the ajax call to the non-existent (in my environment) resource 'wait.php'. The resulting code block is visible at : http://pastie.org/1061480 .

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top