Do I have to use WCF to talk securely to jQuery page
I want to use jQuery $.Ajax calls to a web server running iis w/.net fw 3.5.
Seems that you have to use WCF to have an HTTPS: site using web services?
I'm confused after a lot of reading links - so any help clarifying this would be greatly appreciated.
Thanks!
Re: Do I have to use WCF to talk securely to jQuery page
Hi There,
I cant answer your query directly regarding https, but with regard to Jquery and the $.ajax call, this is how I have implemented it (perhaps this will start you off).
within the .aspx page I have the following code:
Code:
$.dimScreen(1, 0.4, function () {
$('#dimmer').fadeIn();
$.ajax({
type: "POST",
url: "Default.aspx/Process",
data: '{lockton: \'' + encodeURI(textArray) + '\',other: \'' + encodeURI(textArrayOther) + '\'}',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (response) {
if (response != null && response.d != null) { alert(response.d); }
$.dimScreenStop();
location.reload(); }, /* Clear the screen of any completed files that have been moved */
error: function (XMLHttpRequest, textStatus, errorThrown) { $.dimScreenStop(); }
});
});
You can see my $.ajax method calling the function Process passing data via 2 parameters using Json.
in the code behind aspx.cs file the function is declared:
Code:
[WebMethod, ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public static String Process(String lockton,String other)
{.....
Also when using https ALL your references need to be set to HTTPS. i.e. <Script> tags in the header need to have their src set specifically to https.