Closing a form

  • Thread starter Thread starter barry
  • Start date Start date
B

barry

This is asp.net application
This has a requiredfieldvalidator on the form
There is a attributes.add
Button1.Attributes.Add("OnClick", "window.close()")
the application gives what looks like a javascript error saying a
; is needed at the end of a line

When I take the requiredfieldvalidator out it works fine.

Any ideas would be welcome
thanks
 
Hi Barry,

you're using JavaScript code which is similar to C# code.
Wherefore you should to put the ; character in the end of your JavaScript
code in the Button1 sentence, something similar to:

Button1.Attributes.Add("OnClick", "window.close();")

I hope that helps.

Kind Regards,

Jorge Serrano Pérez
MVP VB.NET
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top