This is a migrated thread and some comments may be shown as answers.

ID valus pass from ajax but not receive in Action method Why?

2 Answers 39 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Krunal
Top achievements
Rank 1
Krunal asked on 28 Mar 2014, 07:01 AM

I am Using kendo UI Treeview, there is ajax call of post
method , in browser i see there is id=xx value pass but when i check by
debug point in actionmethod i can't get value there is null why?

i have put code am i doing something wrong?

//View page code

@(Html.Kendo().TreeView()
.Name("treeview1")
.DragAndDrop(true)
.DataTextField("Name")
.DataSource(dataSource => dataSource
.Read(read => read
.Action("Categor", "CategorySet")
))

Controller Code

public ActionResult Categor(int? ID)
{
return Json(categories, JsonRequestBehavior.AllowGet);
}

Browser Code means ajax call

GET http://www.xyz.com/Admin/CategorySet/Categor?id=2 200 OK 96ms

See in url there is ?id=2 But in Action method i can't get this 2. Why.
?
How to solve this?

Thank you in advance
Vinit

2 Answers, 1 is accepted

Sort by
0
Krunal
Top achievements
Rank 1
answered on 28 Mar 2014, 09:38 AM
Please advice
0
Petur Subev
Telerik team
answered on 01 Apr 2014, 07:14 AM
Hello Vinit,

What you shared as code looks completely right. Please send us a sample project that replicates the case so we can investigate what is behind all of this.

Kind Regards,
Petur Subev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Data Source
Asked by
Krunal
Top achievements
Rank 1
Answers by
Krunal
Top achievements
Rank 1
Petur Subev
Telerik team
Share this question
or