Hi AnandM,
I know that one. But how can i do it in codebehind ?
i treid that one but didnt work for me
<script type="text/javascript">
$(function () {
$("#content_btnSave").click(function () {
$.ajax({
type: "POST",
url: " Default.aspx/ValidateNumber",
data: '{number: "' + number + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
error: OnError
});
});
});
function OnError(xhr, errorType, exception) {
var responseText;
$("#dialog").html("");
try {
responseText = jQuery.parseJSON(xhr.responseText);
$("#dialog").append("<div><b>" + errorType + " " + exception + "</b></div>");
$("#dialog").append("<div><u>Exception</u>:<br /><br />" + responseText.ExceptionType + "</div>");
$("#dialog").append("<div><u>StackTrace</u>:<br /><br />" + responseText.StackTrace + "</div>");
$("#dialog").append("<div><u>Message</u>:<br /><br />" + responseText.Message + "</div>");
} catch (e) {
responseText = xhr.responseText;
$("#dialog").html(responseText);
}
$("#dialog").dialog({
title: "jQuery Exception Details",
width: 700,
buttons: {
Close: function () {
$(this).dialog('close');
}
}
});
}
</script>