Access __VIEWSTATE & __EVENTVALIDATION in C#

and277

New Member
In ASP.Net, is it possible to get the values of __VIEWSTATE and __EVENTVALIDATION hidden fields into a variable in C# (server side) in let's say override Render method.I have tried:\[code\]protected override void Render(HtmlTextWriter writer){ StringBuilder stringBuilder = new StringBuilder(); StringWriter stringWriter = new StringWriter(stringBuilder); HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter); base.Render(htmlWriter); string temp = stringBuilder.ToString();}\[/code\]This gives me the entire ASP.Net output. We can get the values by using string function, but I did not find it a very clean solution. Is there a better way to do this?
 
Back
Top