HTML file

amitguitarplayer

Active member
Joined
Jul 5, 2008
Messages
27
Programming Experience
5-10
Hi guys..

here is my dilemma...
I have a plain HTML file.. and a send data button in the HTML. when i click the button i want to send some data to a page or web service on the server and the data is added to the database in the server... how the frell can i do that ! ???

thanx !!
 
You need to submit the form e.g.

<form id="myform" action="yourserverpage.aspx" method="post">
<input type="text" name="txtName" />
{...}
other html controls/elements here
<input type="submit" value="Submit" />
</form>

Now you retrieve the values of the elements posted to the HTTP request.
e.g.

Dim strName As String = Request.Form("txtName")

and so on ...
 
Sure thing. you can also use the XmlHttp object (also know as AJAX) to send the certain values to the server-side page.
VB.NET:
xmlhttp=null;
if (window.XMLHttpRequest)
  {// code for all new browsers
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {// code for IE5 and IE6
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
etc. etc.
Please let me know if you need a further help
 
Back
Top