Passing 'Variable" into ASP project using VB

Discussion in 'ASP .Net' started by Larry, Dec 12, 2003.

  1. Larry

    Larry Guest

    Very new at ASP in dotnet.

    If I put a variable in the URL such as

    http://mysite/myapp.aspx?variable=123

    how do I retrieve the variable from my asp code so that I can use that value
    to determine what I send on my page???

    Thanks,
    Larry
     
    Larry, Dec 12, 2003
    #1
    1. Advertising

  2. Larry

    alien2_51 Guest

    Request.QueryString("variable")

    "Larry" <> wrote in message
    news:QCrCb.34269$8y1.142610@attbi_s52...
    > Very new at ASP in dotnet.
    >
    > If I put a variable in the URL such as
    >
    > http://mysite/myapp.aspx?variable=123
    >
    > how do I retrieve the variable from my asp code so that I can use that

    value
    > to determine what I send on my page???
    >
    > Thanks,
    > Larry
    >
    >
     
    alien2_51, Dec 12, 2003
    #2
    1. Advertising

  3. Larry

    Larry Guest

    That did it. Thank you so much!!!

    "alien2_51" <dan.billow"at"n.o.s.p.a.m.monacocoach.commercialversion> wrote
    in message news:...
    > Request.QueryString("variable")
    >
    > "Larry" <> wrote in message
    > news:QCrCb.34269$8y1.142610@attbi_s52...
    > > Very new at ASP in dotnet.
    > >
    > > If I put a variable in the URL such as
    > >
    > > http://mysite/myapp.aspx?variable=123
    > >
    > > how do I retrieve the variable from my asp code so that I can use that

    > value
    > > to determine what I send on my page???
    > >
    > > Thanks,
    > > Larry
    > >
    > >

    >
    >
     
    Larry, Dec 12, 2003
    #3
  4. Hi Larry,

    Put this in the codebehind file of your ASP.NET page:

    Private Sub Page_Load _
    (ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles MyBase.Load
    Dim intVar As Integer
    intVar = Request("variable")
    Response.Write("You got: " & intVar.ToString)
    End Sub

    "Larry" <> wrote in message
    news:QCrCb.34269$8y1.142610@attbi_s52...
    > Very new at ASP in dotnet.
    >
    > If I put a variable in the URL such as
    >
    > http://mysite/myapp.aspx?variable=123
    >
    > how do I retrieve the variable from my asp code so that I can use that

    value
    > to determine what I send on my page???
    >
    > Thanks,
    > Larry
    >
    >
     
    Ken Cox [Microsoft MVP], Dec 12, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shil
    Replies:
    2
    Views:
    2,075
    Eliyahu Goldin
    Jan 2, 2007
  2. Lisa
    Replies:
    1
    Views:
    140
    Ray at
    Jun 30, 2003
  3. Jonas Daunoravicius
    Replies:
    5
    Views:
    330
    Peter
    Jul 17, 2003
  4. Steve Cosh
    Replies:
    1
    Views:
    176
    joewiii
    Nov 18, 2005
  5. Jonas Daunoravicius
    Replies:
    5
    Views:
    302
    Peter
    Jul 17, 2003
Loading...

Share This Page