Hi Jak,
Check the following steps:
I. In web.config file
Add following section
In <System.web>:
<system.web>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
</system.web>
In <Sytem.WebServer>:
<system.webServer>
<httpProtocol>
<customHeaders>
<!--Enable Cross Domain AJAX calls -->
<remove name="Access-Control-Allow-Origin" />
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
</system.webServer>
II. In Action method
You need to modify action as:
[AcceptVerbs(HttpVerbs.Get)]
public string JoinUser(string callback, string roomid)
{
var JSONString = new JavaScriptSerializer().Serialize("");
return callback+"( "+JSONString + " )";
}
Posted On:
27-Jun-2015 21:22