Click here to Skip to main content
15,921,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI,



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<form action="http://localhost:49251/Service1.svc/AddData" method="post" target="_blank">
<label >FirstName</label>
<input type="text" size="30" name="FirstName" />
<label >LastName</label>
<input type="text" size="30" name="LastName" />
<input type="submit" value="Submit" />
</form>
</body>
</html>


When I click on Submit button,it should call my AddData() wcf function.How to do that?
If possible give me some examples with web.config file also.

WCF:


Public Function AddData() As String Implements IService1.AddData
Return ""
End Function
Posted

1 solution

You should not post a form to a web service, you better use jquery and an ajax call for that: Calling WCF Services using jQuery[^]. But if you stick to it, look here: http://stackoverflow.com/questions/1354749/wcf-service-to-accept-a-post-encoded-multipart-form-data#answer-1407139[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900