Since you finding difficult to follow the article in link, i am just making it simple for you.
Credits to the Author:
Follow the below steps:
Step 1:
Create a new class file (
somename.cs) in you project and just copy paste the code from
this[
^], i tried pasting the code over here, it is not pasting properly.
so you can just replace the existing code in somename.cs file to the code which is available in the link.
Step 2:
Build your project once.
Step 3:
in the comments you have posted this piece of code
@Html.EncodedActionLink(item.StudentName, "Edit", "Employee", new { id = item.StudentID }, null)
So the Controller Name is "Employee" and the Action is "Edit"
Go to EmployeeController -> Edit Action and add the
[EncryptedActionParameter]
attribute to the action as below
[EncryptedActionParameter]
public ActionResult Edit(int? Id)
{
}
Now it should work.
Note: In the article the author has used the below key for
Encryption/Decryption
, you can change it for your need.
string key = "jdsg432387#";