Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i am new to asp.
please anybody tell me what is MAC (used with view state).
thanks in advance

regards
vara prasad
Posted

One of these[^] maybe?
 
Share this answer
 
If you do a View -> Source on your ASP.Net web forms page, you will be able to see the ViewState <input /> field, with the ID __VIEWSTATE. This is nothing but the state of the controls in the page. In general the __VIEWSTATE is a base 64 encoded string, meaning, anybody could decode it and alter/view the state.

In order to prevent that you could add EnableViewStateMAC to your page which would encrypt the __VIEWSTATE data so that nobody could decode and view it without knowing the encryption algorithm and the key which is only known to the server. MAC is nothing but Message Authentication Check.

Refer to the link below:

http://msdn.microsoft.com/en-us/library/ms972976.aspx[^]

Especially the section "View State and Security Implications"

Hope this helps!
 
Share this answer
 
Comments
PRASAD GDV 19-Apr-11 8:47am    
thanks for your solution
Karthik. A 19-Apr-11 9:47am    
you are welcome!
The MAC is the machinekey used as part of the encryption and validation processes.

http://msdn.microsoft.com/en-us/library/w8h3skw9(VS.71).aspx[^]
 
Share this answer
 
Comments
#realJSOP 19-Apr-11 8:34am    
They make trucks too. Oh wait - that's "Mack".
DaveAuld 19-Apr-11 8:54am    
Ah so Mark Morrison was singing about trucks when he released 'Return of the Mack' in the 90's; http://www.youtube.com/watch?v=twgArtVqMlM
#realJSOP 19-Apr-11 8:34am    
But they DO make hand tools, and very nice roll-away tool cabinets.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900