How To Get Script File Name In Asp.net

RegisterLogin
How To Get Script File Name In Asp.net
Post Description: Getting The Current Script File Name From The Url Is Easy With Asp.net We Will Show You How To Obtain It
Tags: How, To, Get, Script, File, Name, In, Asp.net
This Post Was Posted On Oct 07, 2010 By Webune Tutorials #2876
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']

©2012 Webune Forums - Wed Dec 12, 2012 10:42 pm
Powered by: Webune Forums V3