Groups | Blog | Home
all groups > vb.net > february 2005 >

vb.net : Closing a form


barry
2/11/2005 8:00:44 PM
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







Jorge Serrano [MVP VB]
2/11/2005 11:59:01 PM
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


[quoted text, click to view]
barry
2/12/2005 9:29:12 AM
Thanks so much that sure did the trick.
"Jorge Serrano [MVP VB]"
<NOQUIEROSPAMwebmaster@NOQUIEROSPAMportalvbNOSPAM.com.NOQUIEROSPAM> wrote in
message news:1A1EA9A7-4DB0-4EE7-9E6B-4A350A2F7F70@microsoft.com...
[quoted text, click to view]

AddThis Social Bookmark Button