Monday, 15 April 2013

c# - Too many characters in character literal with ajax -



c# - Too many characters in character literal with ajax -

i have simple code webform2.aspx runs ajax request data, when run code, i'm getting error: too many characters in character literal going on?

the output is:

cccccccccccccccccccccccccc <%@ page language="c#" autoeventwireup="true" codebehind="webform2.aspx.cs" inherits="webapplication24.webform2" %> <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>firstajax</title> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { var serviceurl = '/ajaxtest/firstajax'; $.ajax({ type: "post", url: serviceurl, data: param = "", contenttype: "application/json; charset=utf-8", datatype: "json", success: successfunc, error: errorfunc }); function successfunc(data, status) { alert(data); } function errorfunc() { alert('error'); } }); </script> </head> <body> <form id="form1" runat="server"> <div> </div> </form> </body> </html>

probably error here:

$.ajax({ type: "post", url: serviceurl, data: param = "", ///// here, try: data: {param:""}, but, don't know contains `param` contenttype: "application/json; charset=utf-8", datatype: "json", success: successfunc, error: errorfunc });

c# jquery ajax

No comments:

Post a Comment