How to make ViewState secure in ASP.NET
How to make ViewState secure in ASP.NET
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Default11 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void SubmitButton_Click(object sender, EventArgs e)
{
string base64ViewState =@"/wEPDwULLTEwMjc4OTM5MzIPFgIeBHRlc3QFHW9tdmVlciBzaW5naCBpcyBhbiBlbmdpbm5lciAhFgICAw9kFgICAw8PFgIeBFRleHQFHW9tdmVlciBzaW5naCBpcyBhbiBlbmdpbm5lciAhZGRkyOFGkSuL2fAAQOKxFSLR8uu9I8U=";
string decodedstring=Decode(base64ViewState);
}
public string Decode(string str)
{
byte[] decbuff = Convert.FromBase64String(str);
return System.Text.Encoding.UTF8.GetString(decbuff);
}
}
you can use this link.. http://www.codeproject.com/Articles/150688/How-to-make-ViewState-secure-in-ASP-NET