Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have create a new project in mvc4 but in the case of controller return view() is not working,the following code is give below..what is the reason please help me

C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Web.Mvc;

namespace authe.Controllers
{
    public class auController : ApiController
    {
        public ActionResult index()
        {
            return View();//error is the name view does not exist in the current context
        }
    }
}
Posted
Updated 22-Jul-15 19:58pm
v3
Comments
Mostafa Asaduzzaman 23-Jul-15 2:05am    
You are inheriting ApiController, why do you need the view then?
Athul MS 23-Jul-15 2:11am    
ya sure,instead of apicontroller i have using the controller.so its working good thanks
Mukesh Pr@sad 23-Jul-15 2:16am    
pls close the thread if u got the answer.

1 solution

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



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