c# - Validate object ID from GET to POST -
i have method allows user access comment have made on site. have post method lets them update comment.
my normal solution send entire comment
model through, let them update it, update on database when post back. involve sending commentid
through in hiddenfor
, can manipulated.
how can verify commentid
sent in get
method same i'm getting in post
, not able alter comment wish?
how can verify commentid sent in method same i'm getting in post?
basically have validate following things in post
-
- user logged-in user. authenticated users post comments.
commentid
inpost
, should validcommentid
, should present in database.userid
associated logged-in user should sameuserid
associatedcomment
.comment
should containuserid
column, can check @ time of update.
to make sure update happens comment has been sent in get
-
- hold
commentid
insession
, inpost
action comparecommentid
value insession
.
Comments
Post a Comment