request.servervariables("SCRIPT_NAME") asp.net version

Please show me how to retrieve the vb asp.net version of this from asp classic:

request.servervariables("SCRIPT_NAME")

thanks!
LVL 2
Starr DuskkASP.NET VB.NET DeveloperAsked:
Who is Participating?
 
DotNetThinkerConnect With a Mentor Commented:
Does the class inherit from System.Web.UI.Page?
0
 
DotNetThinkerCommented:
C#: Request.ServerVariables["Name"]
VB: Request.ServerVariables("Name")
0
 
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
That's exactly what I already have and asked how to define/retrieve:

request.servervariables("SCRIPT_NAME")
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
I want to know how to define it, assign it, use it please.
0
 
DotNetThinkerCommented:
my bad,

Request.ServerVariables.Add("Name", "Value")
0
 
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
You're not answering my question.

How do I dim and find the value of the "SCRIPT_NAME"

I don't know how many other ways I can ask the same question.


0
 
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
Here is an example that doesn't work. I need to know how to dim it (define it), and retrieve it.

dim scriptname as request.servervariables("SCRIPT_NAME")
0
 
DotNetThinkerCommented:
try to take it easy, you asked how to get the value so I told you, you asked how to assign the value so I told you. If you want to assign the value to a variable you can just ask.




Dim Value as String = Request.ServerVariables("SCRIPT_NAME")

Open in new window

0
 
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
I've tried that. That's why I'm asking here. That doesn't work.

The word "Request" is squiggly underlined.
0
 
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
I am trying to add this to my class and it is saying "Name 'Request' is not declared."
0
 
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
It does now. and it now works.

Thanks!


0
All Courses

From novice to tech pro — start learning today.