Problem showing confirm dialog on button webcontrol's onclick even

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I am facing strange problem
I read Scott mitchell's article about ASP.NET and javascript at

http://www.msdn.microsoft.com/libra...ibrary/en-us/dnaspp/html/clientsidescript.asp

where he has talked about creating a base class for displaying alerts and
confirms after and before postbacks respectively.

I used that Base class to inherit on of my code behind classes and and i
also called the method to attach a confirm (javascript method ) script on a
button's onclick event .
The page works fine so long as there are no validations on the page but as
soon as i incorporate validations the confirm box still apears but the page
validations are skipped and the form is posted back.

This happnes since asp.net also inserts some code for validation after my
code for client side validation methods
it looks somethings like this

onclick='return confirm(message);if (typeof(Page_ClientValidate) ==
'function') Page_ClientValidate(); '

I feel is somehow i can insert my confirm script after the code inserted by
asp.net , then propably my problem is solved.


Please help.

Thanks and Regards

Tarun Upadhyaya
MCP (VB.NET & SQL Server 2000)
 
Oh man, that was so simple.
Thanks a lot Mr Blum.
I had seen you validation controls and beleive me, they are rocking.

Thanks again you have saved many days.
 
Back
Top