473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

is it possibe to post html from vb.net

Hi
I have a requirement to submit form data to a url after collecting the
data from the database.
For example I need to send firstname and lastname through a post method

I can call on the fly.
This is the traditional route below , I want to emulate this submit
action from a vb.class using request.method="post"
<FORM action="http://somesite.com/prog/adduser" method="post">
First name: <INPUT type="text" name="firstname"><BR>
Last name: <INPUT type="text" name="lastname"><BR>
email: <INPUT type="text" name="email"><BR>
<INPUT type="submit" value="Send"> <INPUT type="reset">
</FORM>
clear as mud?
Anyone have any tips ?

Nov 21 '05 #1
2 4122
"andy" <an**@northwaves.com> schrieb:
I have a requirement to submit form data to a url after collecting the
data from the database.
For example I need to send firstname and lastname through a post method


You can find a sample for creating a 'POST' HTTP request here:

<URL:http://dotnet.mvps.org/dotnet/code/net/#CookieRequest>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #2
THis would be something similar to what you are looking for..if anyone sees
any mistakes feel free to chime in.

Public Sub SubmitForAndy
Dim formData As String
Dim uri As Uri

uri = New Uri(txtAddress.Text)
Dim httpReq As HttpWebRequest = DirectCast(WebRequest.Create(uri),
HttpWebRequest)

formData = "username=" & txtUsername.Text & "&password=" &
txtPassword.Text
httpReq.AllowAutoRedirect = True
httpReq.Method = "POST"
httpReq.ContentType = "application/x-www-form-urlencoded()"
httpReq.ContentLength = formData.Length

Dim sw As New StreamWriter(httpReq.GetRequestStream)
sw.Write(formData)
sw.Close()
End Sub

Gary Townsend.

"andy" <an**@northwaves.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hi
I have a requirement to submit form data to a url after collecting the
data from the database.
For example I need to send firstname and lastname through a post method

I can call on the fly.
This is the traditional route below , I want to emulate this submit
action from a vb.class using request.method="post"
<FORM action="http://somesite.com/prog/adduser" method="post">
First name: <INPUT type="text" name="firstname"><BR>
Last name: <INPUT type="text" name="lastname"><BR>
email: <INPUT type="text" name="email"><BR>
<INPUT type="submit" value="Send"> <INPUT type="reset">
</FORM>
clear as mud?
Anyone have any tips ?

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: sammmista | last post by:
hello experts, Plz dont treat this as another newbie query , i did my homework but still getting nowhere :( :( :( Trying to learn PHP on Fedora core 1 (PHP 4.3,MySQL,HTTPD).Unable to post data...
5
by: Michael Foord | last post by:
I'm receiving POST data to a CGI, which I'd like to forward to another CGI using urllib2. I have two options - 1) Parse the data using cgi.FieldStorage() and then rebuild the POST request...
2
by: Erik Johnson | last post by:
I am trying to work with a program that is trying make an HTTP POST of text data without any named form parameter. (I don't know - is that a normal thing to do?) I need to write a CGI program that...
7
by: Rui Pestana | last post by:
Hello all, I want to use the POST method to submit the form and then grab the parameters in the asp file with request.form("parm"). The problem is that I am using the _search target to open...
12
by: Jan Roland Eriksson | last post by:
I have worked some more on this suggested new mFAQ version trying to get all user input to blend into the text. Another review by the NG would be welcome. ===== Archive-name:...
5
by: Jan Roland Eriksson | last post by:
Some more fine tuning and inclusion of last suggested text from regulars has been done to this test post #4 of the mFAQ. As usual, rip it up anywhere you feel that it's appropriate to do so. ...
0
by: WIWA | last post by:
Hi, I want to login to a password protected website and fetch the content of the page behind. I have based my code on http://weblogs.asp.net/jdennany/archive/2005/04/23/403971.aspx. When I use...
24
by: moriman | last post by:
Hi, The script below *used* to work. I have only just set up a server, PHP etc again on my Win98 system and now it doesn't? On first loading this page, you would have $p = and the button...
1
by: pmasclark | last post by:
Hello, I created a web site, site A, that redirects to another web site, site B, where a simple web service is hosted. The code to call the web service is simple. oWS.AllowAutoRedirect = True...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.