Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 738
  • Last Modified:

C# OnClick -- perform required field validation then close browser window

Hello Experts.

I am wanting to close a browser window using C#.  Here's the scenario. I have Request for information form that opens in a new browser window.  Users provide information and click a submit button.  When the submit button is clicked it validates the required fields and then sends an email.

I would like to then provide an alert that says "Your request has been sent" and then close the window.

I've tried adding javascript but it fires before the fields are validated.  

How do I accomplish this.  I will settle for just closing the browser window if the Alert box is too involved.

0
soapygus
Asked:
soapygus
1 Solution
 
Jaime OlivaresSoftware ArchitectCommented:
you can invoke a C# method from your onclick event, and do the job in C# instead of javascript.
Have a look to this article:
http://msdn2.microsoft.com/en-us/library/a0746166(VS.80).aspx
0
 
soapygusAuthor Commented:
Thanks Jaime.

This answer worked for me:
http://www.experts-exchange.com/Programming/Misc/Q_21384413.html
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now