PDA

View Full Version : Loading mask on a page with only ASP.NET controls



mhe
30 Jan 2010, 2:36 PM
Hi, my application has an .aspx page that has only ASP.NET controls. Is there a way to show an ExtJS loading mask that covers the entire page when a button (also an ASP.NET control) on that page is clicked? Thanks!

hendricd
30 Jan 2010, 2:39 PM
@mhe --
Sure, just call:

Ext.getBody().mask();
....
Ext.getBody().unmask();

mhe
30 Jan 2010, 4:16 PM
@mhe --
Sure, just call:

Ext.getBody().mask();
....
Ext.getBody().unmask();

I put "Ext.getBody().mask()" in the "onClientClick" event of the button but did not see a mask showing when the button was clicked. Any idea?

hendricd
31 Jan 2010, 7:46 AM
I put "Ext.getBody().mask()" in the "onClientClick" event of the button but did not see a mask showing when the button was clicked. Any idea?

How is your <BODY> styled when you call mask?

Showing some code/markup might be helpful.

mhe
31 Jan 2010, 8:20 PM
How is your <BODY> styled when you call mask?

Showing some code/markup might be helpful.

Here is the markup of a test page I made. There is only a button on the page. I'm hoping to show a loading mask when the button is clicked.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" src="Scripts/ext-3.0.0/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="Scripts/ext-3.0.0/ext-all-debug.js"></script>
<script language="javascript" type="text/javascript">
function showLoadingMask()
{
Ext.getBody().mask();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:Button ID="Button1" runat="server" Text="Button"
OnClientClick="showLoadingMask()" onclick="Button1_Click" />
</form>
</body>
</html>

In "Button1_Click", I simply put "Thread.Sleep(100000000);". Thanks!

hendricd
3 Feb 2010, 3:51 PM
@mhe -- You're missing ext-all.css !!

mhe
4 Feb 2010, 7:40 AM
@mhe -- You're missing ext-all.css !!

oh yea, you are absolutely right. Thank you so much!