如提
protected void Button1_OnClick(object sender, EventArgs e)
{
        if (Request.Headers["accept"] != "*/*")
        {
            //不是重复提交
            //执行代码
        }
        else
        {
            //重复提交
        }
}

解决方案 »

  1.   

    最好是仿照csdn上面的,提交后提交按钮隐藏, 页面跳转.
      

  2.   

    这个我也不清楚,你可以看下这个
    转,孟老大的解决方法 如何区分刷新和提交? DetectRefresh.aspx 
    =========================== <%@   Page   Inherits= "StevenBey.Web.UI.Page "   %> 
    <html> 
    <head> 
    <title> Detecting   Page   Refresh   [Demo] </title> 
    </head> 
    <body> 
    <form   runat= "server "> 
    <asp:button   Text= "Test   Refresh "   runat= "server "   /> 
    </form> 
    IsRefresh   =   <%=   IsRefresh   %> 
    </body> 
    </html> 
    StevenBey.Web.UI.Page.cs 
    ====================== 
    namespace   StevenBey.Web.UI 

    public   class   Page   :   System.Web.UI.Page 

    private   bool   _refreshState; 
    private   bool   _isRefresh; public   bool   IsRefresh 

    get 

    return   _isRefresh; 

    } protected   override   void   LoadViewState(object   savedState) 

    object[]   allStates   =   (object[])   savedState; 
    base.LoadViewState(allStates[0]); 
    _refreshState   =   (bool)   allStates[1]; 
    _isRefresh   =   _refreshState   ==   (bool)   Session[ "__ISREFRESH "]; 
    } protected   override   object   SaveViewState() 

    Session[ "__ISREFRESH "]   =   _refreshState; 
    object[]   allStates   =   new   object[2]; 
    allStates[0]   =   base.SaveViewState(); 
    allStates[1]   =   !_refreshState; 
    return   allStates; 


    }
      

  3.   

    不行。
    ======================================
    首次加载(如果直接打开)
    GET /csdn/Default2.aspx HTTP/1.1
    Accept: */*
    Accept-Language: zh-cn
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET4.0C; .NET4.0E)
    Host: localhost:26522
    Connection: Keep-Alive首次加载(超链接打开)
    GET /csdn/Default2.aspx HTTP/1.1
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*
    Referer: http://localhost:26522/csdn/Default2.aspx
    Accept-Language: zh-cn
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET4.0C; .NET4.0E)
    Host: localhost:26522
    Connection: Keep-Alive
    按钮事件:
    POST /csdn/Default2.aspx HTTP/1.1
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*
    Referer: http://localhost:26522/csdn/Default2.aspx
    Accept-Language: zh-cn
    Content-Type: application/x-www-form-urlencoded
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET4.0C; .NET4.0E)
    Host: localhost:26522
    Content-Length: 659
    Connection: Keep-Alive
    Cache-Control: no-cache__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=%......&TextBox1=F5刷新提交:
    POST /csdn/Default2.aspx HTTP/1.1
    Accept: */*
    Referer: http://localhost:26522/csdn/Default2.aspx
    Accept-Language: zh-cn
    Content-Type: application/x-www-form-urlencoded
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET4.0C; .NET4.0E)
    Host: localhost:26522
    Content-Length: 659
    Connection: Keep-Alive
    Cache-Control: no-cache__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=%.....&TextBox1=