Posts

Showing posts with the label AJAX

[SOLVED] JQuery - AJAX 500 Internal Server Error - JSON - jQueryAjax

Image
The above error always occur if you work with jQuery + Ajax. The error above may have several reason why the error occur and one of the reason is you are using the different parameter name to post to the server. Let say the method getState in webservice require one parameter which will represent country name, you must use the exactly name parameter to request from webservice. The Other Reason Not using JSON.stringify to pass parameter value. If you not supply type in jQuery, it will use GET method which is not accept in your webservice configuration. Add  ( type : "POST ) in your jQuery code to use POST method. You are actually request data from different domain. Cross Domain Request (CORS)which is not allowed. Please read here Content type not supply or not correct. Use " application/json; charset=utf-8 " DataType not not supply or not correct. Use json or jsonp By Mohd Zulkamal NOTE : – If You have Found this post Helpful, I will appreciate if you can Share it on Fa

XMLHttpRequest Example with Webservice asp.net

Image
AJAX is a group of interrelated web development techniques used on the client-side to create asynchronous web applications. If you want to retrieve information from server side and you do not want to fully post the entire page to the server side, you need to use ajax in your web page. This post show example how to use simple XMLHttpRequest Object in your web page to get the information from server side. The Javascript AJAX  <script type="text/javascript">         function createXHR() {             if (typeof XMLHttpRequest != "undefined") {                 return new XMLHttpRequest();             } else if (typeof ActiveXObject != "undefined") {                 if (typeof arguments.callee.activeXString != "string") {                     var versions = ["MSXML2.XMLHttp.6.0", "MSXML2.XMLHttp.3.0",                      "MSXML2.XMLHttp"];                     for (var i = 0, len = versions.length; i < len; i++) {

Integrate Timer with UpdatePanel to async page update - ASP.NET

Image
The Example show integration Timer with UpdatePanel to update page asynchronously. The ASPX Page   <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <!-- Interval time 5000 will be 5 second --> <asp:Timer ID="Timer1" runat="server" Interval="5000" ontick="Timer1_Tick"> </asp:Timer> <asp:Label ID="Label1" runat="server"></asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /> </Triggers> </asp:UpdatePanel> <asp:UpdateProgress ID="UpdateProgress1" Displa