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.
I´m already using PageModel Property.
In my scenario I have a grid filter and paging where I have to persist filter & page value between posts. So hidden fields are set and form submitted by javascript.
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.
Participant
1061 Points
665 Posts
MVC @Request["someName"] is there an equivalent in Core Razor Pages
Aug 14, 2019 06:52 PM|jzero|LINK
In MVC after postback I can persist a hiddenfield value using
How can I have same behavior in Razor Pages other than using page property like
All-Star
194428 Points
28073 Posts
Moderator
Re: MVC @Request["someName"] is there an equivalent in Core Razor Pages
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.
Participant
1061 Points
665 Posts
Re: MVC @Request["someName"] is there an equivalent in Core Razor Pages
Aug 14, 2019 09:45 PM|jzero|LINK
I´m already using PageModel Property.
In my scenario I have a grid filter and paging where I have to persist filter & page value between posts. So hidden fields are set and form submitted by javascript.
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.
All-Star
194428 Points
28073 Posts
Moderator
Re: MVC @Request["someName"] is there an equivalent in Core Razor Pages
Aug 15, 2019 08:52 AM|Mikesdotnetting|LINK
So have you resolved your issue or do you still require assistance?
Participant
1061 Points
665 Posts
Re: MVC @Request["someName"] is there an equivalent in Core Razor Pages
Aug 15, 2019 03:22 PM|jzero|LINK
Done.
Thanks