I am trying to create a function that when a button is clicked it will pass all my records to my json page which will save my data. This is what i have so far
var t = this;
t.RecordsSave = function ($http) {
for (var i = 0; i <t.records.length; i++) {
var record=t.recordss[i];
var data = params( {
record: record.Number[i],
[Code] ....
I get the following error "params is not defined"
and "Cannot read property '0' of undefined"
How should i go about this. not familiar with angular js
I am new to jqGrid and I have found it difficult to follow the documentation jqGrid Documentation / I cannot figure out how to call a WebMethod when setting up the JQGrid. I have been successful in making an Ajax call to get the data and then setting up the JQGrid with local data. I think its an extra step in the setup process and that I should be able to provide the path to the webmethod using the url property. The editurl property is the same way. I am never actually receiving the post to the server. Attempted JQGrid Setup
function GetData() { $('#list').jqGrid({ type: "POST", url: "Default.aspx/GetUsersJSON", datatype: "json", height: 250, colName: ['Username', 'Email'], colModel: [ ... }).jqGrid( 'navGrid', '#pager', { edit: true, add: true, del: true }); } WebMethod [WebMethod] public static string GetUsersJSON() { var users = new List(); using(UserAdministrationSandboxDataContext uasd = new UserAdministrationSandboxDataContext()) { users = uasd.GetUserList(); } JavaScriptSerializer serializer = new JavaScriptSerializer(); return serializer.Serialize(users); }
Current Code I got it working correctly now, but I still have one final question. Why did I have to set the 'repeatitems: false' in order to display the content? Some of the caveats to get this to work include the different ways to setup the ajax request. (Ajax: type) is (jqgrid : mtype) (Ajax: contentType) is (jqgrid : ajaxGridOptions: { contentType: })
And finally understanding the documentation from the documentation on how to setup the JSONReader.
function GetUserDataFromServer() { $('#list').jqGrid({ url: "Default.aspx/GetUsersJSON", mtype: 'POST', ajaxGridOptions: { contentType: "application/json" }, datatype: "json", serializeGridData: function (postData) { return JSON.stringify(postData); }, jsonReader: { root: function (obj) { return obj.d; }, page: function (obj) { return 1; }, total: function (obj) { return 1; }, records: function (obj) { return obj.d.length; }, id:'0', cell:'', repeatitems: false }, datatype: "json", height: 250, colName: ['Username', 'Email'], colModel: [ { name: 'Username', index: 'Username', width: 100, editable: true }, { name: 'Email', index: 'Email', width: 220, editable: true }, { name: 'IsLockedOut', index: 'IsLockedOut', width: 100, editable: true, edittype: 'checkbox' } ], caption: "Users" }) } Web Method [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public static List GetUsersJSON() { using (UserAdministrationSandboxDataContext uasd = new UserAdministrationSandboxDataContext()) { return uasd.GetUserList(); } } One JSON Object from the List {"__type":"UserAdministrationSandbox.UserData","PKID":"00000000-0000-0000-0000-000000000001","Username":"TestUser","ApplicationName":"Test","Email":"TestUser@test.com","Comment":"TestUser","Password":"D41D8CD98F00B204E9800998ECF8427E","PasswordQuestion":"Is this a blank Password?","PasswordAnswer":null,"IsApproved":true,"LastActivityDate":"/Date(1298869200000)/","LastLoginDate":"/Date(1298869200000)/","LastPasswordChangedDate":"/Date(1298869200000)/","CreationDate":"/Date(1298869200000)/","IsOnLine":false,"IsLockedOut":false,"LastLockedOutDate":"/Date(1298869200000)/","FailedPasswordAttemptCount":0,"FailedPasswordAttemptWindowStart":null,"FailedPasswordAnswerAttemptCount":null,"FailedPasswordAnswerAttemptWindowStart":null}
I have 2 web pages edit.aspx and webmethods.apx. In edit.aspx there is some jquery code to get some data :
[Code]....
With this I try to get a Json object from the webmethods.aspx page :
[Code]....
I get an error back that says "Parser Error", I even did put an breakpoint on the webmethod but it is like it's never triggered. Is my url wrong if I'm in the following url :
I am trying to make a jquery ajax call to a static method on the codebehind file. The problem is that ArtistManager injected by Spring is not static and I cannot use it in the static webmethod. I am looking for any ideas on how to implement this
I have a 2007 excel addin app (VS2005) which calls a web service (also developed in VS2005). When the webservice returns a large amount of data I get the following exception
System.InvalidOperationException: There is an error in XML document (1, 14493956). ---> System.Xml.XmlException: '', hexadecimal value 0x1C, is an invalid character. Line 1, position 14493956. at System.Xml.XmlTextReaderImpl.Throw(Exception e)
I want to call MsCaptcha Control in Static WebMethod,for validating. so,I want to check mscaptcha value in javascript or jquery without refresh the page.I think it is my solution that i use JqueryAjax.
i manage to add recrod via jquery ajax call to webmethod but i want to update the dropdown list once the record is been added. i dont want to use update panel. what would be the best way of doing that.
XP Pro,aspnet 2, IIS, Oracle I have a primary webpage that displays a tab and some summary data. The tab uses an iframe and the summary data is loaded by an async WebMethod call back to C#. The iframe page takes a short while to load depending on how much data is in there (sometimes upto 20 seconds?). The WebMethod call, or at least the content of it, is very fast. BUT, the WebMethod call won't return until basically the iframe has finished loading.
I've verified through Fiddler that the browser is initiating both requests at basically the same time. It's initiating the iframe call first followed immediately by the WebMethod call within the same second. My understanding is that browsers are limited to only two calls at once.
If I set a breakpoint at the end of my WebMethod call (even commenting out ALL it's guts so it just returns an empty string), that breakpoint won't fire until the aspnet page serving up the iframe has finished. Using threads window, I see both calls at the server. I just don't understand why the server won't actually run the Webmethod call until the first call has finished. I've searched the code looking Monitor.Enter, lock, etc to make sure nobody has inserted any other type of blocking code and I can't find anything. I've basically emptied out the WebMethod call and it just returns a string, but no matter what I do, it just won't return as fast as it can. If I comment out the iframe, then the WebMethod call returns within 2 seconds. With the iframe, it "looks" like the the webmethod call won't return until the iframe has finished.
1) Does aspnet only process one request per aspnet session id? Is it FIFO? I figured the webserver would just process requests and return each request as fast as it can.
2) What else can I do to get that summary data to return faster (but not actually loading and putting the data into the very first primary page) ?
I have a service that works great on my development box. It uses JQuery to hit my web service, and then the JSON results are sent back.
The web service is located on our basePage.cs. We didn't want to put out an external WebService for this. Our on beta box something different is happening.
The web page seems to be trying to call the web method correctly - the JSON data is being sent... but the server doesn't seem to know it's a webmethod. here's my service function (it's in our basepage.cs which inherits from Page).
It seems like ASP.NET WebMethods are not "web servicey" enough to work with New-WebServiceProxy. Or maybe it is, and I haven't figured out how to initialize it?
The uc:Control code: [WebMethod()] [ScriptMethod()] protected void LoadData() { //stuff happens here }
I can't figure out what kind of selector to use. I have multiple controls on the page, and I want to call them at different times. What kind of selector or what command do I use to run this WebMethod?
In my web app, if user clicks a button, I have to kick off a long running task. I have to keep the user informed about the status of execution of the task from time to time. To accomplish this, I create a thread on button click which makes a synchronous webservice call. The webmethod works on a long running task; while the main thread informs the users about the status of execution.
Currently the webmethod call times out in approximately 90 seconds. I want to increase the timeout to 10 mins. I tried setting <httpRuntime executionTimeout="600"/> along with debug="false"; but in vein. Can anyone tell me what I am missing?
I am currently working with ASP.NET and the person who designed the form has used all Server Controls for things like TextBoxes and Dropdowns etc when really they are not providing postbacks.. Some of the dropdowns and textboxes are values that I need only in jQuery so as far as I can see there are no drawbacks to coverting these controls to standard html controls rather than ASP.NET server controls?
I suppose I will need to continue to have my GetDataGrid button as a server control because I will need it to postback (and receive PageLoad events etc - all asp.net events) to update the GridView? Or would it be possible to use the GridView (server control) from a Webmethod and call it via Jquery?
Of course in my webmethod I would need to the instance of the gridview to add the datasource - but I don't see how this would be possible without being in the ASP.NET events - or maybe I wrong?
The other thing I thought of was changing the GetGridView button to a standard HTML and calling the javascript postback from the client click event?? This way it would do a real postback and I would end up in Page_load.
Taking everything into effect i don't want to the change the GridView asp.net control as it funcions well as an asp.net server control but i am unsure how i would do this.
I remember a document being available that said "how to use asp.net webforms without server controls" but i can't seem to find it. I suppose using webforms like asp.net MVC - but i can't change the project to MVC - its out of my control.
I am using a webform and trying to use a $.ajax call a webmethod on my code behind to format and return some data. It sounded easy but I need the help of an expert. Here is what I have and perhaps someone could steer me in the right direction to solving this problem. for the time being all I want the [webmethod] to return is some dummy data so the jqgrid displays, after I get it displaying correctly I will work on the data column format. So for this sample to work correctly user would open web from and click on button "Load Grid" when this is clicked it calls the the [webmethod] on the server, the sever then gets the data and passes it back to the jquery .ajax call and then it gets loaded into the jqGrid.