javascript - Passing parameter via Ajax -


I am working on a project and facing a problem. What is the problem in my code, it can not be detected. Below is my code, do not know why the ajax URL function is not able to obtain the number of ReceivedMessageByIndexNumber.aspx. Thank you.

Javascript:

  received message (1); Function ReceivedMessage (indexNumber) {$ .ajax ({Type: "Post", URL: "Default.aspx / ReceivedMessageByIndexNumber? IndexNumber =" + Indexing, Content Type: "Application / Jason; Charset = UTF-8", Datatype: " Jason ", success: work (reaction) {var data = response.d; for (var i = 0; i & lt; data; langti; i ++) {warning (data [i]);}}, failure : Function (msg) {$ ('# output'). Text (msg);}}); }   

Default.aspx:

  [WebMethod] The message barred index number (int text index) received from the public static bull {string connectionString = @ "data Source = localhost; initial catalog = information system; integrated security = true "; (SqlConnection connection = New SqlConnection (connectionString)) (SqlCommand command = connection.CreateCommand ()) (connection.Open (); Command.CommandText = @ "TextWord SELECT SELECTINDEX = 'TextProperty ='" + textIndex + "' "; Command.ExecuteNonQuery (); Back to true;}}    

This is an HTTP POST Method but you are trying to pass the same parameter, it is an HTTP GET. I have never written it, where you can specify the parameters in the URL such as an HTTP GET.

Notice I would like to add the Jasonan Data Line below This fills up your post request.

  Data: '{textIndex:' indexNumber + '"}',   

Full Function: Message Received Function (IndexNumber) {$ .ajax ({Type: "Post", URL: "Default .aspx / Received MessagebindNumber", Content Type: "Application / Jason; Charset = Utf -8 ", datatype:" Jason ", data: '{textIndex:' 'indexNumber +'"} ', success: function (response) {var data = response D; (Var i = 0; i & lt; data.length; i ++) {warning (data [i]);}}, failure: function (msg) {$ ('# output'). Text (msg);}}); }

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -