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.