Multiple choice technology web technology

Is it possible to add object in ViewState in .NET?

  1. Not Possible

  2. Always Possible

  3. Only If object have Serializable feature or have TypeConverter option

  4. Only if object is an String

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

ViewState in ASP.NET can store objects, but the object must be serializable. Objects marked with the [Serializable] attribute or those with a TypeConverter can be stored in ViewState. Non-serializable objects cannot be persisted because ViewState needs to convert objects to a string format for transport.