Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
151 views
in Technique[技术] by (71.8m points)

c# - How to solve route problem using RedirectToRouteResult

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...