I have something like in asp.net core (I am using asp.net core c# using razor):
@Html.ActionLink("Edit", "EditEmployee","Employee", new { id = item.id})
this item.id is base64string which will decode in middle layer and it has slash('/') character in encoded string so action is not able to understand it and action parameter is null.
my question is how i can send this item.id to my action as it is base64string containing slash('/').
this is my map route in startup.cs:
routes.MapRoute(
name: "EditEmployee",
template: "{controller=Employee}/{action=EditEmployee}/{id?}");
This is my action which i need to call... but sue to double slash parameter is getting null.
[HttpGet]
[ActionName("EditEmployee")]
public async Task<IActionResult> EditEmployee(string id)
{
if (!string.IsNullOrEmpty(id))
{
var result = await _accountAction.GetEditEmployee(id);
if (result.Item1)
{
return View(result.Item2);
}
}
return RedirectToAction(nameof(ListEmployee));
}