Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

is it possible to persiste customize object in view state?
how it is?

Answer Posted / satish v itagi

You have to use <Serializable()> attribute prefixed to the
class declaration before you keep object of this class in
viewstate. However, larger the object, slower will be
performance. There will be risk of viewstate getting
corrupted.

Eg
'' in class definiton:
<serializable()> Public Class Fruit
private sName as string
public sub new(ByVal Name as string)
sName = Name
End Sub
readonly property Name as string
Get
return sName
end get
End Class

''in code behind:
if page.ispostback = false
dim MyApple as new Fruit("Kashmiri Apple")
ViewState("oMyFruit") = MyApple
end if

'' In button click
label1.text = ctype( ViewState("oMyFruit") , Fruit).Name

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to comment out asp.net tags?

1053


What does aspcompat="true" mean?

1025


Explain the basic functionality of garbage collector?

981


What are the features of asp net?

972


What is the procedure to create the environment for asp.net? : asp.net mvc

1041


What is sdlc process?

992


What does it mean your session has timed out?

981


Is LINQ performance wise better or using sqlcommand?

5091


What is use of <% %> in asp.net?

1012


What is the difference between session and application?

947


Contrast oop and soa. What are tenets of each16. How does the xmlserializer work? What acl permissions does a process using it require?

979


Where the assembly is stored in asp.net?

1004


Explain swagger components.

1003


What does mean by a neutral culture?

1073


What is viewstate? In which event of the page life cycle, is the viewstate available?

1015