0

I have create a sample program in Asp.net which updates time on a button click. This time is shown in a label. Button and and label both are inside update panel say upd1. Following is the aspx code

<script type="text/javascript" >
function fnhn() {

    __doPostBack("upd1","");
    return false;
}
</script>
</head>
<body>
<form id="form1" runat="server">
     <asp:ScriptManager id="ScriptManager1" runat="server" EnablePageMethods ="true"  >    </asp:ScriptManager> 
<div>
 <asp:UpdatePanel ID="upd1" runat ="server" ><ContentTemplate > 
 <asp:label runat="server" id="lbl_c" ></asp:label>
  <asp:button runat="server" id="btn_b" Text="Click" />
 </ContentTemplate>
 </asp:updatepanel>
</div>
</form>
</body>

and following is the source code.

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    lbl_c.Text = Date.Now.ToString
End Sub
End Class

Now problem which i facing is as follows. I am able to update this time on button click without any postback in any browser other than IE 10. In IE10 my whole page gets refresh. which I obviously dont want to happen. Plz help me guys.

In a thread I also come to know about up leveling the user agent of IE10 through following.

Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
    If Request.UserAgent.ToLower.ToString.Contains("msie 10.0") Then
        Page.ClientTarget = "uplevel"
    End If
End Sub

Which didnt help me to come out of this issue. Any comment suggestion and solution is valuable.

4

2 回答 2

0

你能检查一下你的 IE10 是否允许 cookie 吗?如果您在某个时候禁用了 cookie,则会话将无法工作(如果基于 cookie),因此 AJAX 将导致完整的回发。

于 2013-08-28T08:02:17.530 回答
0

您是否尝试过添加 EnablePartialRendering?这应该是默认值,但可能会在其他地方被覆盖。

<asp:ScriptManager id="ScriptManager1" runat="server" 
            EnablePageMethods="true" EnablePartialRendering="true" />
于 2013-08-28T08:08:00.020 回答