locked
Auto-submit an asp page from aspx page. RRS feed

  • Question

  • I want to call another asp page("Login.asp") from my form load of aspx page (Scraping.aspx) and populate certain values in the aspx page based on the results returned from asp page.
    I have to pass certain parameters like username and password to the asp page("Login.asp") and the form should be submitted automatically .
    How to implement the form submission of asp page automatically from the aspx page. Based on the search results in the redirect asp page("Main.asp"), i have to populate values in aspx page(Scraping.aspx)

    Note: I must need this in POST methode


    I have used the below code but Auto-submit on asp page doesn't happen

    NameValueCollection formData = new NameValueCollection();
    formData["txUser"] = "SMITH";
    formData["txPass"] = "244557719";
    formData["cmdGoLive"] = "Submit";
    // add more form field / values here
    WebClient webClient1 = new WebClient();
    byte[] responseBytes = webClient1.UploadValues(LOGIN_URL, "POST", formData);

    string content1 = System.Text.Encoding.GetEncoding("utf-8").GetString(responseBytes);

    Response.Write(content1);


    In asp page(POST method)
    txUser=====><input type="text" name="txUser" size="10" class="body">

    txPass=====><input type="password" name="txPass" size="10" class="body">

    <input type="submit" value="Go" name="cmdGoLive" class="body">

    Help me



    • Moved by SachinW Wednesday, March 3, 2010 7:46 AM Moving from MSDN and TechNet Search Feedback Forum, please move or answer as necessary (From:MSDN and TechNet Search Feedback)
    Friday, October 16, 2009 7:35 AM

Answers

  •  

    Hello ,

     

    Thank you for your post!  I would suggest posting your question in the ASP Forum located here:  http://forums.asp.net  


    Have a great day!

    Thanks!


    SachinW Tier 2 Application Support Server and Tools Online Operations Team
    • Proposed as answer by SachinW Tuesday, March 9, 2010 11:55 AM
    • Marked as answer by SachinW Wednesday, August 25, 2010 6:48 AM
    Tuesday, March 9, 2010 11:55 AM