Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. posting data to remote URL using WebBrowser

posting data to remote URL using WebBrowser

Scheduled Pinned Locked Moved C#
questioncsharp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shabya
    wrote on last edited by
    #1

    hello, i am using the WebBrowser Navigate to navigate to a webpage from my c# application. i try to post data to a form which is in that page. (its my page , i control it) first , what is the name of the field i need to put in the post string? is it ID or NAME ? second , i tried various methods but none filled the form textbox with the information i sent. what am i doing wrong? here's the c# code

    WebBrowser Web = new WebBrowser();
    string postdata = "ctl00_pass=1234";
    System.Text.Encoding a = System.Text.Encoding.UTF8;
    byte[] SendBytes = a.GetBytes(postdata);

    Web.Navigate(WebBase + WebAddress, WebTitle, SendBytes, "Content-Type: application/x-www-form-urlencoded");
    .

    and here's the website

    <form name="aspnetForm" method="post" action="default.aspx?key=5555" id="aspnetForm">

    <input name="ctl00$pass" type="text" id="ctl00_pass" />

    </form>
    .

    tnx

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups