I have following serverside onclick method:
protected void btnSearch_Click(object sender, EventArgs e)
{
if (txtSearch.Text == "" || txtSearch.Text.Length < 4) {
//NO POSTBACK HERE
} else {
Response.Redirect(www.google.be);
}
}
So any advice here? I can’t do it the clientside way, because I need to give a server side parameter within the url.
Thanks for help
you cannot avoid the postback once you are already executing the server side Click event.
alternatives:
in yoour case I think you can simply do everything client side, the code you provided above is easy to write in JQuery.