ASP Form Action Question

Discussion in 'C#' started by revengz, Oct 24, 2007.

  1. #1
    Im having a little trouble doing some ASP form coding.

    First off.

    What im trying to do is
    1st ASP Page:
    Is a search page where someone can enter in a customer id or lastname

    2nd ASP Page:
    is a processing page
    where it checks whether was entered is correct and if not will be redirected to another page

    3rd ASP Page:
    If the input was correct and has passed the processing asp page it will lead to here which is the selected page
    which is the result of the search in the database from the first asp page

    the trouble im having is...

    I need to retrieve the input from the 1st ASP page to be used on the 3rd ASP page
    but i cant because the 1st ASP page FORM ACTION is directed to the 2nd ASP Page.

    Googling it up... I have read that a FORM can only perform ONE action.
    Is there a way for my 3rd ASP page to gain access to what was in the input on the 1st ASP page?

    Thanks

    Rev

    :confused:
     
    revengz, Oct 24, 2007 IP
  2. Indian_Webmaster

    Indian_Webmaster Banned

    Messages:
    1,289
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yes definitely there is a way to do this.
    Make use of session variables.

    you can store that value in session variable on 2nd page.
    ie. Session("lastname") = Request("lastname")

    and now on the 3rd page you can access that session variable.
    ie. lastname = session("lastname")

    Hope this helps...
     
    Indian_Webmaster, Oct 24, 2007 IP
  3. revengz

    revengz Member

    Messages:
    78
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    48
    #3
    hey cool thanks
    But it gives me an error saying that the data i input was not an int
    how do i go about surpassing this error?
     
    revengz, Oct 24, 2007 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The more common way to do this type of thing would be to append it to the redirection and then use request.querystring on the next page to gather the information.

    That said though, why are you using 4 pages (input, validation, results, error)? Why doesnt the results page do the validation and pass to error if there is a problem?
     
    AstarothSolutions, Oct 24, 2007 IP
  5. BuildHome

    BuildHome Well-Known Member

    Messages:
    837
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    108
    #5
    Show us your current code...:rolleyes:
     
    BuildHome, Oct 24, 2007 IP
  6. Managerglory

    Managerglory Peon

    Messages:
    155
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Well, just as asta.... said,

    Something like the below;

    First page -> sends the data you wants to use - <Form>....</Form>
    Second page -> recieves the data - data=Request.QueryForm("data")
    Second page ->Response.Redirect "third_page.asp?data="&data
    Third page -> Recieves the data - Request.Querystring("data")

    Cheers!
     
    Managerglory, Oct 25, 2007 IP