@using(Html.BeginForm(“ Action”,“ Controller”,FormMethod.Get)
{
@Html.TextBoxFor(model=>model.Id)
<input type="submit" value="Search" />
}
1-当我们单击“提交”按钮时,将这样创建网址
http://localhost:53734/Controller/Action?id=10
//10 is input From Textbox
我想像这样加密Id参数 http://localhost:53734/Controller/Action?id=encrypted的价值10
答案 0 :(得分:0)
据我了解,您想“隐藏”和“保护”请求。最好的解决方案是:
如果不可能,请使用RSACryptProvider加密参数。通用加密代码在MSDN中:https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.rsacryptoserviceprovider?view=netframework-4.7.2