When you attach a client-side click event via jQuery to an ASP.NET button do you then lose the ability to do a postback? I merely need to do some jQuery prior to the server-side stuff happening and it seems to be interrupting this process.
$('[id$="btnDisableAlarms"]').click(function () {
var commentValue = $('[id$="txtComment"]').val();
if (commentValue == "") {
// add red border (CSS)
$('[id$="txtComment"]').addClass("redCommentError");
}
return;
});
The button is wired up with a click event but the browser doesn't budge.
btnDisableAlarms.Click+=new EventHandler(btnDisableAlarms_Click);
public void btnDisableAlarms_Click(object sender, EventArgs e)
{
Response.Write("Still able to manage a postback from server");
}