I am using Ajax in a .NET project (not MVC.net). I want to call my .aspx.cs function from a JScript function.
This is my JScript code:
$ ("a # showQuickSearch"). Click (function () {if ($ ("$ quick_search_controls"). ": Hidden")) {$. Ajax ({Type: "Post", url: "default.aspx / SetInfo", Data: "{showQuickSearch}", Content Type: "Application / Jason; Charset = UTF-8" $ ("Slow"); $ ( "# Search_controls"). Hide (): "json", success: function (response) {warning (response d);}}); $ ("# Quick_search_controls"). ; $ ("# Search") Hide ();} and {$ ("# quick_search_controls"). Hide ();}}); And this is my .aspx.cs function:
[WebMethod] Public string setInfo (string stringation) {Label1.Text = strChangeSession; Return "This is an examination"; } The problem is that my .aspx.cs function is not being called and it is not updating the label. Text.
Try to stabilize your functions.
[WebMethod] Public Static String SetInfo (String Stacked Session) {//Label1.Text = strChangeSession; This wont work back "This is an examination"; }
Comments
Post a Comment