Hi,
I have created an Ajax enabled WCF web service that contains this simple method:
[OperationContract]
public string ParameterizedConnectionTest(string word)
{
return string.Format("You entered the word: {0}", word);
}
I can invoke the Web service with this client side JQuery code:
<script type="text/javascript">
function btn_Connect_onclick() {
$.ajax({
type: "POST",
url: "/MySimpleService.svc/ParameterizedConnectionTest",
contentType: "application/json; charset=utf-8",
dataType: "json",
data:'{"word":"Wolverine"}',
success: function(data) {
alert(data.d);
}
});
}
So basically when I click the input button what I get is a message box with the result from the Web service plus the new word. "You entered the word: Wolverine"
I want to know how I could pass the input value like "Wolverine" from a text box instead of being hardcoded and then display that value in another textbox instead of a message box.
Right now I am using a simple .html page.
thank you.