- Forums
- ASP
- How To Get Script File Name In Asp.net
Getting The Current Script File Name From The Url Is Easy With Asp.net We Will Show You How To Obtain It [3657], Last Updated: Mon Jun 24, 2024
Webune Tutorials
Thu Oct 07, 2010
0 Comments
794 Visits
welcome to Webune support forums
we provide Window Web Hosting
if you are a beginner programmer in ASP.NET and you want to know how to display the script file name you are currently using you might find this tutorial useful.
lets say we have a file called filename.asp
how can we get the file name to be displayed within your script. ok, this is how we are going to do it.
lets create some code, open your text editor (like notepad) and copy and paste the following code:
ASP CODE:
The name of this file is: <%
= Request.ServerVariables("URL")
%>
now save the file as filename.asp and run it on your IIS server. (open it with your browser to see it in action)
you should see something like this:
OUTPUT:
The name of this file is: /filename.asp
if you are familiar with PHP, this is similar to $_SERVER['PHP_SELF']