How get a data from a web page in ASP

Discussion in 'C#' started by friendpu, Jan 23, 2008.

  1. #1
    Hi there everyone,

    I am new in ASP and want to get data from a web page. I have IP address, username and password of the web page but I have not access to database of that web page. After login to web page, I want to select three options from dropdown lists, first is name, second month and third year. After that I want to submit form and then page shows data. I want to get that data and show in my page. Could anyone guide me……………..

    Thanks in advance.
     
    friendpu, Jan 23, 2008 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
  3. qman107

    qman107 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    For a small form which is passed to the ASP page, you could do something like this:

    <%
    response.write("Submitors Name: " & request.form("name")) & "<br>"
    response.write("Extension: " & request.form("ext")) & "<br>"
    response.write("Department: " & request.form("dept")) & "<br>"
    response.write("Submit Date: " & request.form("date")) & "<br><br>"
    %>

    For a larger form, something like this will produce a list of all form fields:
    <%
    'iterate through each form field from passed html form, exclude specific fields shown below
    Dim fldName
    For Each fldName in Request.Form
    if (fldName <> "preview.x") AND (fldName <> "preview.y") AND (fldName <> "name") AND _
    (fldName <> "ext") AND (fldName <> "dept") AND (fldName <> "date") then
    Response.Write fldName & ": " & _
    Request.Form(fldName) & "<br />"
    end if
    Next
    %>

    Good luck.... I am using the above code for a huge form, I want to show only fields that have data so that I dod not have to exclude them as I am doing above.
     
    qman107, Jan 24, 2008 IP
  4. terryson01

    terryson01 Guest

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi,
    Why u not try ASP.NET its easier than ASP.It have so many tools that is familiar with web enviornment.
    thanks
     
    terryson01, Jan 29, 2008 IP
  5. zibapo

    zibapo Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You can get data from an external page via XmlHTTP or a component like AspTear.
     
    zibapo, Feb 1, 2008 IP
  6. amitfan

    amitfan Active Member

    Messages:
    842
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #6
    I use that all the time
     
    amitfan, Feb 3, 2008 IP