c# and ASP.NET interview question :- How can you check if viewstate is tampered.

48 1 0
                                        

This ASP.NET interview question was asked in Accenture to one of my friends.

View state is simple HTML hidden field. So it's possible very much possible that some one

can tamperThis hidden field easily. To ensure that viewstate is not tampered we can set the "EnableViewStateMac" attribute to true. This attribute found in the "page" directive in ASPX page. Below is a simple code snippet which show how to use the same.

After the above question Iwas asked one more connecting ASP.NET interview question:- Diffrence between session and viewstate ? Watch this vedio for better understanding.

Regards,

This question is taken from the book .NET interview question by Shivprasad koirala.

...Where stories live. Discover now