How to use parameters in ASP


I'm a beginner with ASP. could anyone tell me how to use parameters on my asp pages? in PHP I only have to submit them to my url like test.php?Myparam=Hello%20world&MySecondPar=ABCDEFG in the code itself I can then use my parameters like: print $Myparam

When I open my asp testpage

Response.Write "<P>Today is " & Date () & "."
Response.Write "

Parameter is " & par & ".



like this: test1.asp?par="hello"

it doesn't show hello Why not, what do I have to do to make this work ?

the Netherlands...


  • [b][red]This message was edited by chick80 at 2002-9-8 11:8:51[/red][/b][hr]
    It doesn't write nothing because par is not defined!
    Try this:

    Dim param
    param = Request.QueryString("par")
    Response.Write "Parameter is: " & param
    This if you pass the parameter with GET.
    If you pass it with POST you'll have to use
    param = Request.Form("par")


    [italic]How beautiful, if sorrow had not made Sorrow more beautiful than Beauty itself.[/italic]

  • Thanxxx I will try it.
    the Netherlands...

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!