Sharepoint 2010, update panel在chrome裏不能postback的問題

Sharepoint 2010, update panel在chrome裏不能postback的問題, 可以用此方法解決:


When you are using Update panel in asp.net..You will find problem that it is not working in google chrome and safari

So for this you have to just following steps..

Step 1 :
You need to add a little bit of javascript in to aid the Ajax.NET framework in recognising WebKit based browsers that looks like the following:

if(typeof(Sys.Browser.WebKit) == "undefined") {
    Sys.Browser.WebKit = {};
}
 
if(navigator.userAgent.indexOf("WebKit/") > -1 ) {
    Sys.Browser.agent = Sys.Browser.WebKit;
    Sys.Browser.version = 
        parseFloat(navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]);
    Sys.Browser.name = "WebKit";
}


?
Step 2 :
You need to add that to a javascript file and reference it in your ScriptManager:


<asp:scriptmanager id="ScriptManager1"runat="server">
    <scripts>
        <asp:scriptreference path="~/javascript/WebKit.js">
    </asp:scriptreference></scripts>
</asp:scriptmanager>


?
That's it.Now Updatepanel will work in Google Chrome and all other browsers..

你可能感兴趣的:(Sharepoint 2010, update panel在chrome裏不能postback的問題)