if you use register.clientscript the page need to be reloaded. Instead use webmethod to do serverside validation and show the popup accordingly depending on the validation. Here is the code
Default.aspx
<html>
<head>
<script src="Scripts/jquery.js" type="text/javascript"></script>
</head>
<body>
<script type="text/javascript">
$(document).ready(function () {
$("#Result").click(function () {
alert("clicked");
$.ajax({
type: "POST",
url: "Default.aspx/validate",
data: "{'value':'"+$("#value").val()+"'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
if (msg.d == "true")
$("#value").val("THis is validated");
else
$("#value").val("THis is not validated");
},
error: function (err) {
debugger;
}
});
});
});
</script>
<input type="text" id="value" />
<input type="submit" id="Result" />
</body>
</html></html>
Default.aspx.cs
public partial class Default : System.Web.UI.Page
{
[WebMethod]
public static string validate(string value)
{
if (value.Equals("showpopup"))
return "true";
else
return "false";
}
}
Hope this answers your question