Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I use ASP.NET MVC 6(DNX 4.5.1). Just got the error.
JavaScript
HttpRequestMessage' does not contain a definition for 'Form' and no extension method 'Form' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?);


Code:
C#
// UPDATE
        [Microsoft.AspNet.Mvc.HttpPut]
        public void UpdateVendor()
        {
            try
            {

                var item = new Vendor()
                {
                    Company = Request.Form["Company"],
                    // other columns
                };
                _vendorRespository.UpdateVendor(item);
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
            }
        }
Posted
Comments
Sergey Alexandrovich Kryukov 21-Jan-16 15:16pm    
Do you have an input control with the attribute name="Company" in that form?
—SA
[no name] 21-Jan-16 15:19pm    
Yes, I have.
Sergey Alexandrovich Kryukov 21-Jan-16 15:53pm    
All right, thank you.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900