Click here to Skip to main content
15,892,746 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionJQuery/JSON/ASP.Net/AJAX/Entity Framework trouble Pin
Jasmine25011-Apr-13 11:06
Jasmine25011-Apr-13 11:06 
AnswerMessage Closed Pin
2-Apr-13 7:14
professionaljkirkerx2-Apr-13 7:14 
GeneralRe: JQuery/JSON/ASP.Net/AJAX/Entity Framework trouble Pin
Jasmine25012-Apr-13 11:16
Jasmine25012-Apr-13 11:16 
GeneralMessage Closed Pin
2-Apr-13 11:24
professionaljkirkerx2-Apr-13 11:24 
GeneralRe: JQuery/JSON/ASP.Net/AJAX/Entity Framework trouble Pin
Jasmine25012-Apr-13 12:35
Jasmine25012-Apr-13 12:35 
AnswerMessage Closed Pin
2-Apr-13 11:36
professionaljkirkerx2-Apr-13 11:36 
GeneralRe: JQuery/JSON/ASP.Net/AJAX/Entity Framework trouble Pin
Jasmine25012-Apr-13 12:59
Jasmine25012-Apr-13 12:59 
AnswerRe: JQuery/JSON/ASP.Net/AJAX/Entity Framework trouble Pin
jkirkerx2-Apr-13 16:44
professionaljkirkerx2-Apr-13 16:44 
I've come to the conclusion that KendoGrid is an advanced Jquery Object sort of like CKEditor, and that it has an code interface that is the go between the UI Object, and backend support for creating, updating and deleting records via a web service.

Let's take the Web Service first. I suspect that it should be registered on a asmx page, and not aspx page. I don't know if that is your mistake or the way it was packaged from Kendo Dojo as an example.
TestKendoGrid.asmx/Update


The following web method takes a non-primitive value. So instead of person being an integer or string, it's an object called person, that must be described somewhere on that page, or somewhere in the project.
Person pIn is the non-primitive. Once again, I don't if you wrote this, or if it was provided as a live example, but in order to consume person, it must be pre-consumed first and then consumed, and the object elements must be described somewhere in the web method or a seperate class.

So Update returns nothing, no exit code or anything. Only List returns data back as an object called person, and not a JSON String. That why you can't stringify the object. There must be something in the KendoGrid file that parses the Person Object, and updates the KendoGrid.

From what I can tell, People is an array or a table, collection, and person is a single record in People.

[WebMethod]
public static void Update(Person pIn) {
	//updates an existing Person entity with new values, and saves to the database
	using (SandboxEntities e = new SandboxEntities()) {
		//there should be only one (by definition of PK)
		//but using "First()" is safe in case there is more than one
		Person pUpdate = (Person)(from p in e.People where p.ID == pIn.ID select p).First();
 
		pUpdate.Phone = pIn.Phone;
		pUpdate.FirstName = pIn.FirstName;
		pUpdate.LastName = pIn.LastName;
 
		e.SaveChanges();
	}
}


In my opinion, this is a custom program or solution, made to be easy to use and customized, and that you need to get the example code working first, before making any changes. The Kendo DoJo must have a forum or help source that you can get a better answer from than here.

I'm not going to dive into downloading the demo, and setting up a complete project to figure this one out.

I deleted my other posts, because they are not relevant to this subject, just misleading for those that follow.

Let me know if this is pure demo code, or if you started writing code from scratch to support the Kendo Grid. If it's pure demo code, then you missing a file for person and people.
GeneralRe: JQuery/JSON/ASP.Net/AJAX/Entity Framework trouble Pin
Jasmine25012-Apr-13 18:34
Jasmine25012-Apr-13 18:34 
GeneralRe: JQuery/JSON/ASP.Net/AJAX/Entity Framework trouble Pin
jkirkerx3-Apr-13 6:56
professionaljkirkerx3-Apr-13 6:56 
GeneralRe: JQuery/JSON/ASP.Net/AJAX/Entity Framework trouble Pin
Jasmine25013-Apr-13 9:40
Jasmine25013-Apr-13 9:40 
GeneralRe: JQuery/JSON/ASP.Net/AJAX/Entity Framework trouble Pin
jkirkerx3-Apr-13 10:39
professionaljkirkerx3-Apr-13 10:39 
GeneralRe: JQuery/JSON/ASP.Net/AJAX/Entity Framework trouble Pin
Jasmine25013-Apr-13 13:05
Jasmine25013-Apr-13 13:05 
GeneralRe: JQuery/JSON/ASP.Net/AJAX/Entity Framework trouble Pin
jkirkerx3-Apr-13 16:03
professionaljkirkerx3-Apr-13 16:03 
GeneralRe: JQuery/JSON/ASP.Net/AJAX/Entity Framework trouble Pin
Jasmine25013-Apr-13 18:12
Jasmine25013-Apr-13 18:12 
GeneralRe: JQuery/JSON/ASP.Net/AJAX/Entity Framework trouble Pin
jkirkerx3-Apr-13 18:38
professionaljkirkerx3-Apr-13 18:38 
GeneralRe: JQuery/JSON/ASP.Net/AJAX/Entity Framework trouble Pin
Jasmine25014-Apr-13 6:44
Jasmine25014-Apr-13 6:44 
QuestionSocial Share Component Pin
Jassim Rahma1-Apr-13 5:43
Jassim Rahma1-Apr-13 5:43 
AnswerRe: Social Share Component Pin
Sandeep Mewara1-Apr-13 6:18
mveSandeep Mewara1-Apr-13 6:18 
GeneralRe: Social Share Component Pin
AspDotNetDev1-Apr-13 6:41
protectorAspDotNetDev1-Apr-13 6:41 
GeneralRe: Social Share Component Pin
Sandeep Mewara1-Apr-13 6:52
mveSandeep Mewara1-Apr-13 6:52 
GeneralRe: Social Share Component Pin
AspDotNetDev1-Apr-13 7:01
protectorAspDotNetDev1-Apr-13 7:01 
GeneralRe: Social Share Component Pin
Sandeep Mewara1-Apr-13 7:20
mveSandeep Mewara1-Apr-13 7:20 
AnswerRe: Social Share Component Pin
AspDotNetDev1-Apr-13 6:40
protectorAspDotNetDev1-Apr-13 6:40 
GeneralRe: Social Share Component Pin
Jassim Rahma1-Apr-13 6:43
Jassim Rahma1-Apr-13 6:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.