I have an aspx login page and in my controller class works as a webhook page getting response from api
but i have to insert userid who is currently logged in and using the service but my webhook page works only in beta
in my table i have to insert userid how can i?
im doing only in asp.net taking apicontroller class to hit APIs
Jayraj ChhayaPosted Apr 3, 2024, 6:34 AM
To send the user ID from the ASPX login page to the controller class, you can utilize the ASP.NET session state to store and retrieve the user ID. In the ASPX.CS file, after successful login, store the user ID in the session:
Then, in your controller class, retrieve the user ID from the session:
You can then use this
userIDto insert the user ID into your table. Ensure to handle cases where the session might be null or expired.