Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Submit a form from code

Reply
Thread Tools

Submit a form from code

 
 
Shawn
Guest
Posts: n/a
 
      07-04-2005
Hi.
I'm given a URL that takes me to a page that looks someting like this:

<html xmlns:fo="http://www.w3.org/1999/XSL/Format">
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
<link href="css/default.css" REL="stylesheet">
<body onLoad="document.forms[0].submit()">

<form
action="http://internal-server//login.asp?fds=File&doc=102&current=1&seq=1"
method="post" name="form1">
<input type="hidden" name="username" style="width: 150px" value="test_user">
<input type="hidden" name="password" style="width: 150px" VALUE="test_pass">

<input type="submit" value="Login" style="width: 80px">

</form>
</body>
</html>

When the page loads it automatically logges me onto the system and then
redirects me to a file (pdf, xsl, doc etc). My problem is that I have to
download this file through my code and store it on the web server without a
user interface. Is there someone who can tell me how I can accomplish this?

Thanks,
Shawn


 
Reply With Quote
 
 
 
 
bhawin13@indiatimes.com
Guest
Posts: n/a
 
      07-04-2005
Hello Shawn,
You want to do operation idealy performed by your browser. Am I right?
Find class that that allow you to send request and able to grab the
response.
That response will be saved in variable then store it where you want.
I dont know excatly but i think you will get such class in system.net.
happy coading
bhawin13

 
Reply With Quote
 
 
 
 
bhawin13@indiatimes.com
Guest
Posts: n/a
 
      07-04-2005
Hello Shawn,
You want to do operation idealy performed by your browser. Am I right?
Find class that that allow you to send request and able to grab the
response.
That response will be saved in variable then store it where you want.
I dont know excatly but i think you will get such class in system.net.
happy coading
bhawin13

 
Reply With Quote
 
=?Utf-8?B?bG9uZG9uIGNhbGxpbmc=?=
Guest
Posts: n/a
 
      07-04-2005
Hi Shawn, as bhawin13 suggested the class you are looking for is
System.Net.HttpWebRequest

jd

"Shawn" wrote:

> Hi.
> I'm given a URL that takes me to a page that looks someting like this:
>
> <html xmlns:fo="http://www.w3.org/1999/XSL/Format">
> <head>
> <META http-equiv="Content-Type" content="text/html; charset=UTF-16">
> <link href="css/default.css" REL="stylesheet">
> <body onLoad="document.forms[0].submit()">
>
> <form
> action="http://internal-server//login.asp?fds=File&doc=102¤t=1&seq=1"
> method="post" name="form1">
> <input type="hidden" name="username" style="width: 150px" value="test_user">
> <input type="hidden" name="password" style="width: 150px" VALUE="test_pass">
>
> <input type="submit" value="Login" style="width: 80px">
>
> </form>
> </body>
> </html>
>
> When the page loads it automatically logges me onto the system and then
> redirects me to a file (pdf, xsl, doc etc). My problem is that I have to
> download this file through my code and store it on the web server without a
> user interface. Is there someone who can tell me how I can accomplish this?
>
> Thanks,
> Shawn
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert form to submit on load instead of clicking submit button? Network-Man HTML 5 07-07-2012 12:06 PM
submit 1 form to 2 servers or 2 forms to 2 server (1 form each) on 1 submit abansal.itp@gmail.com Javascript 3 06-23-2007 07:29 AM
Forms with multiple submit buttons vs 'form' objects with single 'submit' methods neil.fitzgerald@ic.ac.uk Python 4 04-14-2006 04:58 PM
submit the form data to the popup window without a submit button jrefactors@hotmail.com HTML 2 01-01-2005 06:07 AM
Form submit - hitting enter does not trigger Submit button ASP General 2 10-25-2004 03:37 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57