Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# IIS 8 Can';我看不到局部视图_C#_Asp.net Mvc - Fatal编程技术网

C# IIS 8 Can';我看不到局部视图

C# IIS 8 Can';我看不到局部视图,c#,asp.net-mvc,C#,Asp.net Mvc,当发布到部分视图时,VisualStudioWeb服务器会在本地识别该视图并运行该方法,但从IIS8服务器运行时,会出现404找不到页面错误 在我的家庭控制器上的代码中,我有这个功能 [HttpPost] public Void UpdateUserSystem(bool isChecked, int SystemId, int UserID) { // if isChecked then add system to user in the UserSys

当发布到部分视图时,VisualStudioWeb服务器会在本地识别该视图并运行该方法,但从IIS8服务器运行时,会出现404找不到页面错误

在我的家庭控制器上的代码中,我有这个功能

    [HttpPost]
    public Void UpdateUserSystem(bool isChecked, int SystemId, int UserID)
    {
        // if isChecked then add system to user in the UserSystems table else remove it.

        UserSystemBI usBI = new UserSystemBI();

        if (isChecked)
            usBI.InsertUserSystem(UserID, SystemId);
        else
            usBI.DeleteUserSystem(UserID, SystemId);
    }
我还向
http://dalwindev03/Home/UpdateUserSystem?SystemId=4&UserID=5&isChecked=false

当我在Dalvindev03服务器上执行此操作时,它根本找不到UpdateUserSystem“视图”,而是在本地找到同一url(
http://localhost:10127/Home/UpdateUserSystem?SystemId=4&UserID=5&isChecked=false
)它没有问题,点击该函数并运行代码


我到底错过了什么?

当您试图部署的文件的生成操作设置为“无”而不是“内容”时,我遇到了这个问题。在解决方案资源管理器中,打开缺少的视图的属性。确保“生成操作”设置为“内容”

这是我所说的属性窗口:


确保“构建操作”设置为“内容”。这句话很有帮助。经过4天的浪费,我终于解决了这个问题。

你是如何将网站发布/部署到web服务器的?我正在执行“构建”->“发布到本地文件夹”,然后复制并粘贴到web服务器应用程序目录。其他一切正常,包括另一个页面上的一些ajax。您的视图是什么样子的?“提交”按钮是在“部分”按钮中还是在“主要”按钮中?您可能需要查看EditorTemplates而不是Partials。你是使用部分还是渲染部分?不是这样,我只是想出来了…这很愚蠢。在Web服务器上,我需要拼出应用程序名,所以应该是