在網速慢或者網站反應慢的情況下
通過使用HttpModule
通過使用HttpModule
這種方法使用簡單
<httpModules>
<!
<add name=
</httpModules>
下面是實現代碼
/// NonReduplicatePostModule 的摘要說明
/// </summary>
public class NonReduplicatePostModule : System
{
private static ILog log = LogManager
private const string hiddenFileName =
private const string maskdivScriptRelativeUrl =
private const string onformSubmit =
private HttpApplication context = null;
#region IHttpModule 成員
public void Init(HttpApplication context)
{
ntext = context;
ntext
}
public void Dispose()
{
ntext
}
#endregion
private void context_PreRequestHandlerExecute(object sender
{
HttpApplication webApp = sender as HttpApplication;
if(webApp != null)
{
//已經處理過
Page page = webApp
if(page != null)
{
page
//找到Page
if(webApp
{
string flag = webApp
if(webApp
{
log
if(page is IReduplicatePostHandler)
{
webApp
}
else
{
webApp
}
}
else
{
//放進緩存中
webApp
}
}
}
}
}
private void page_PreRender(object sender
{
Page page = sender as Page;
if(page != null)
{
//找到Page
page
//表單UI顯示 MASKDIV
page
page
}
}
}
public interface IReduplicatePostHandler
{
void OnReduplicatePost(HttpContext context
}
internal class ReduplicatePostHandler : IHttpHandler
{
private IReduplicatePostHandler handler = null;
internal ReduplicatePostHandler(IReduplicatePostHandler handler)
{
this
}
internal ReduplicatePostHandler()
{
}
#region IHttpHandler 成員
public void ProcessRequest(HttpContext context)
{
if(handler != null)
{
handler
}
else
{
context
}
}
public bool IsReusable
{
get
{
// TODO: 添加 ReduplicatePostHandler
return false;
}
}
#endregion
}
用到的JS文件:/js/MaskDIV
Evlon = {};
Evlon
{
var div = window
div
div
div
div
div
div
div
div
div
this
div = window
div
div
div
div
div
div
this
this
{
//創建半透明DIV
window
//創建提示DIV
window
window
}
this
{
if(window
{
document
window
}
if(window
{
window
document
window
}
}
}
Evlon
window
{
var sign = window
if(sign !=
{
//創建半透明DIV
Evlon
}
return null;
//return sign;
}
From:http://tw.wingwit.com/Article/program/net/201311/13804.html