Hey everyone, I'm wondering about the best way to handle IDs for deletion in my ASP.NET Core app. When a user clicks the delete button, it takes them to another page where they can see detailed info about the row, like an employee's data, with the ID showing up in the URL (e.g., id=12).
Would it be better to use something like `Request.Query["id"]` to get that ID and pass it directly to a stored procedure for deletion? Or would it be smarter to create a cookie to hold that ID and retrieve it from there? I know you can't store a value in `OnGet` and use it in `OnPost` since they are different states, so I'm curious how you all handle this situation!
1 Answer
Another option is to include a hidden input field within a form that wraps your delete button, which holds the ID. Since you need to display the data to your users anyway, you can directly use that ID without relying on cookies or query strings!

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically