RE: Javascript and .Net Validation controls...

From: Kostadin Kostov (KostadinKostov_at_discussions.microsoft.com)
Date: 02/02/05


Date: Wed, 2 Feb 2005 03:49:03 -0800


  <script language="javascript">
    function ConfirmDelete()
    {
      return confirm("Are you sure you want to delete this?");
    }
  </script>

in code behind:
   btn.Attributes.Add("OnClick", "return ConfirmDelete();");

Also you may use this in js function:

                  if (!Page_ClientValidate ())
                          return;
if the validators don't pass the check, the function stops executing.

Hope that helps!
Regards,
Kostadin Kostov

You may use this code. If you click OK on the confirm window that pops up,
then the validator controls will be checked if valid and if so, the form will
be submitted by the Button btn.

"Roh" wrote:

> Hi,
>
> Can we use Javascript and .Net Validation controls on the same page. If yes how?
> Please provide some examples which will help me a lot....thanks.
>