Found Alternate solution to resolve this issue.
1) Set
EnablePageMethods
property of your
ScriptManager
to
true.
<asp:scriptmanager id="ScriptManager1" runat="server" enablepagemethods="true" xmlns:asp="#unknown">
</asp:scriptmanager>
2)Write a
static
method in
code-behind(aspx.cs) and add
System.Web.Services.WebMethod
attribute to it.
[System.Web.Services.WebMethod]
public static void MyWCFMethod()
{
}
3) And then call your
WebMethod
in Javascript as below.
function BeforeNavigate()
{
var isConfirm = confirm("Do you want to Navigate?");
if (isConfirm )
{
PageMethods.MyWCFMethod();
return false;
}
}
Hope this will be usefull. Cheers - Rais