Hello everyone,
I am pretty sure if this was in a form I could simply just put
var name = this.Request.Form["txtName"];
To get the value in the action. But since its not a form I am just trying to get this value of a hidden input in my controller so I can use it in the method.
I have tried passing in the name of the input in the action parameters using a session/TempData but that does not work because in a new tab it then uses this same value so I have to have a set value saved on the page and use that value in the controller.
I thought I could do a QueryString but also I have not had luck passing this into the action. Here is what I have.
<input id="txthguid" name="txthguid" type="hidden" value="@TempData["guid"]" />
<input asp-for="TabGuid" type="hidden" value="@TempData["guid"]" />
@await Component.InvokeAsync("DataPage", Model)
public async Task<IViewComponentResult> InvokeAsync(string sessionID, object txthguid, LNPartVM model)
{
if (TempData != null)
{
TempData.Keep();
}
List<LNPartVM> lstData = null;
try
{
_logger.LogInformation(txthguid.ToString());
_logger.LogInformation(TempData["guid"].ToString());
var jsonResponse = "";
var tabGuid = Request.Query["txthguid"];
_logger.LogInformation(tabGuid);