Friday, 15 March 2013

asp.net mvc - MVC How to hide link's Html Attribute for security -



asp.net mvc - MVC How to hide link's Html Attribute for security -

i pass model value(id) action action this:

controller part:

homecoming redirecttoaction("saveaction", "mycontroller", new { myid= model.id});

view part:

@html.hiddenfor(model => model.id)

another view example:

@html.actionlink("delete", "delete", new { myid= model[i].id, anotherid= model.[i].anotherid})

and on link bar, it's beingness showed this:

http://localhost:9151/controller/save?id=180

when alter "180" "181", user can see id=181's values related view. it's of import security problem me , users can not reach other id values 181, 182, 183 etc.

how can pass id value safely action action , how can not show id value in browser's link bar?

is there easy way this?

a simple way encode , decode id.

more secure way encrypting id.

asp.net-mvc asp.net-mvc-3 asp.net-mvc-4

No comments:

Post a Comment