mvc4中的新项目,但在控制器返回视图()的情况下不起作用 [英] new project in mvc4 but in the case of controller return view() is not working

查看:44
本文介绍了mvc4中的新项目,但在控制器返回视图()的情况下不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在mvc4中创建了一个新项目,但是在控制器返回视图()的情况下无法正常工作,下面给出以下代码..请问有什么原因请帮助我



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

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
        }
    }
}

推荐答案

您好,



请参阅以下链接...



使用MVC 4.0创建一个简单的应用程序 [ ^ ]



用于理解和实现ASP.NET Web API的初学者教程 [ ^ ]



http://www.asp.net / web-api / overview / getting-started-with-aspnet-web-api / tutorial-your-first-web-api [ ^ ]



MVC使用Web API和JQuery来获取或POST数据 [ ^ ]
Hello,

Just Refer the Below Link...

Creating a simple application using MVC 4.0[^]

A Beginner's Tutorial for Understanding and Implementing ASP.NET Web API[^]

http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api[^]

MVC using Web API and JQuery to GET or POST Data[^]


这篇关于mvc4中的新项目,但在控制器返回视图()的情况下不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆