Last post Aug 15, 2019 03:22 PM by jzero
Aug 14, 2019 06:52 PM|jzero|LINK
In MVC after postback I can persist a hiddenfield value using
<input type="hidden" id="hdfSearchType" name="hdfSearchType" value="@Request["hdfSearchType"]" />
How can I have same behavior in Razor Pages other than using page property like
<input type="hidden" asp-for="hdfSearchType" name="hdfSearchType" />
Aug 14, 2019 07:39 PM|Mikesdotnetting|LINK
Why don't you want to use PageModel properties or tag helpers? If you want to continue to use Request["..."], you might as well not use Razor Pages at all.
But if you are set on going that route, you could try Request.Query["hdfSearchType"].ToString()
If it's a form field rather than a query string value, you will have more hoops to jump through. A PageModel property is the simplest option.
Aug 14, 2019 09:45 PM|jzero|LINK
I´m already using PageModel Property.
Ok, lets deal with Page Properties.
I´m VB & Webforms, in last weeks I have been playing around C#, MVC, Razor Pages and Core.
I´m really surprised how they are different and (at some point) some basic MS documents are not clear enough.
By the way info provided by your websites are very helpfull.
Aug 15, 2019 08:52 AM|Mikesdotnetting|LINK
So have you resolved your issue or do you still require assistance?
Aug 15, 2019 03:22 PM|jzero|LINK