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

Error CS0104 'HttpVerbs' is an ambiguous reference between 'System.Web.Mvc.HttpVerbs' and 'Kendo.Mvc.UI.HttpVerbs'

1 Answer 158 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
manoj
Top achievements
Rank 1
manoj asked on 20 Jul 2017, 06:00 PM

I am trying to create a page with grid format and I used kendo controller also installed kendo in my system but its showing me this error. I have used code first entity framework for the code.

 [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult companys_Create([DataSourceRequest]DataSourceRequest request, company company)
        {
            if (ModelState.IsValid)
            {
                var entity = new company
                {
                    companyname = company.companyname
                };

                db.companys.Add(entity);
                db.SaveChanges();
                company.companyid = entity.companyid;
            }

            return Json(new[] { company }.ToDataSourceResult(request, ModelState));
        }

 

I am getting error at httpverbs. Can anyone give a solution.

1 Answer, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 21 Jul 2017, 08:25 AM
Hi,

You can use the fully defined name:
[AcceptVerbs(System.Web.Mvc.HttpVerbs.Post)]

This should resolve the ambiguity.

Regards,
Bozhidar
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
manoj
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Share this question
or