capturing variables

  • Thread starter Thread starter Carlos
  • Start date Start date
C

Carlos

Hi all,

this question is probably trivial, but I just need to know
how to capture a variable name, and its value when it is
being passed from a URL address...i.e. if I have
http://www.mysite.com?myvar=itsvalue
Then I would be able to process such variable in my code
behind logic. is this type of variable called session variable in the asp
jargon?

Thanks,

Carlos.
 
Hi Carlos,

In that case, the variable is being passed on the querystring. You can pick
it up in ASP.NET and store it in a variable like this:

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim strVar As String = ""
If Not IsNothing(Request.QueryString("myvar")) Then
strVar = Request.QueryString("myvar")
End If
Response.Write(strVar)
End Sub

Ken
 
Back
Top