Im using MVC 5 .net c#. Current pages is: EmpMeasureList
so i use below code as link to go edit pages called EmpSetup with selected id in table.
@return Html.Raw(string.Format("<text ><a data_id = "{0}" href="EmpSetup?id={0}&view=false" data-toggle="tooltip" title="Edit" class="text-success" data-original-title="Edit"><i class="fas fa-fw fa-edit"></i></a></text>", item.KpiId));
But sometimes the the link is ok like this :
https://localhost:44307/Kpi/EmpSetup?id=32&view=false
sometimes the link is looks like this :
https://localhost:44307/Kpi/EmpMeasureList/EmpSetup?id=32&view=false
i found that, the changes trigger when im redirect back to EmpMeasureList after edited.
Redirect Code after Edit in Controller :
return RedirectToActionPermanent("EmpMeasureList", "Kpi", new { id = model.PersonalPlanId });
question from:
https://stackoverflow.com/questions/65623521/how-to-solve-route-problem-using-redirecttorouteresult 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…