You don't need javascript  or the OnClientClick features at all.

As Cerebrus mentioned, the CustomValidator option will work just as
easy.  Better yet, the RequiredValidator may even be easier, if you're
just making sure something is in your textbox, as it will check if it
is empty.  If it is empty, it'll let you know.  if not, it will
process your code.

Read on both the CustomValidator and the RequiredFieldValidator here:
http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/validation/default.aspx

On Aug 17, 10:20 pm, Suraj <[email protected]> wrote:
> Hi,
>
> I have a search button I my aspx page. When the user clicks on search, it
> has to do first client side validation i.e., check if the user has entered
> any data by using javascipt and then should go to code behind.
>
> So, the button will have two functions  OnClick="btnSearch_Click" and
> OnClientClick="btn_check" in the source of aspx page.
>
> Is this correct?
> If not, how can i achieve both client and server side validation on search
> button.
> Thanks,
>
> Regards,
>
> Suraj

Reply via email to