asp.net - How can I hide one user's content from other user? -


Let's have both A and B users, they created an account and now they have their profile page, both users can add, about them Can edit information in When user opens A b's profile page, for example, the page control, add, edit button should not be visible to it.

Store user's user ID in session on login. Provide a variable anywhere (such as a base class which extends across all pages). Then on that page, if the User ID matches the login user, show the control otherwise. Do not forget to validate the user ID when submitting user control, because it is possible to inject malicious data into a different user id.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -