In ASP.NET you can get the page name using the HttpRequest object. Look at the following 2 examples and you can easily convert it from C# to VB, PHP, PERL or whatever.
This will include the relative path to the form.
This only includes the name of the page or form.
This is helpful if you are using master pages with content pages as you may need to know what you page you are showing on the master page.