简体   繁体   中英

How to Solve Server Error in '/' Application

I'm getting this error:

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /SideBar/Save/0

Controller

Solution

控制器 2

在此处输入图片说明

I using a SideBarController and my View (Save) have place properly. Why is the resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable?

I don't understand how to solve it....

TQ

I think you pass 0 as a URL but you pass some available record id that is the issue:

You need to change here:

@Html.ActionLink("Edit", "Edit", new { UserId=item.UserId})

when you click on edit link then for example:

SideBar/Save/12

Click on Edit Button and check if the id is shown then you should be going edit record

if above criteria did not work then here come:

if give again error nullable type then change again in the controller:

[HttpGet]

public ActionResult Save(int? id)
{

}

it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM