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?

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / raovarinder singh

Yes it is possible to persiste customize object in view
state, Supposed your are having one variable named x for
which you want to persist the view state.

dim x as integer
ViewState(Value) = x

Which can then be accessed as follows:

x = ViewState(Value)

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More ASP.NET Interview Questions

How you can use video conferencing in asp.net? guys plz help me ...

2 Answers  


How do I debug an asp.net application that was not written with visual studio.net and that does not use code-behind?

0 Answers  


How do you sign out from forms authentication?

0 Answers   MCN Solutions,


what is the difference between console.writeline &console.output.writeline?

2 Answers  


About the Usage of htmlencode and urlencode ?

2 Answers   Cognizant,


What is asp.net with mvc? : Asp.Net MVC

0 Answers  


how can you bind data from dataset to XML file

2 Answers   LG Soft,


When Garbage Collector will run and how its identifing whether the Object is used or Not.?

2 Answers   Verizon,


Where is cookie used in asp.net?

0 Answers  


Explain model, view and controller represent in an mvc application? : asp.net mvc

0 Answers  


Difference between datagrid and datareader?

1 Answers  


What is different in .net 1.1 and .net 2.0?

0 Answers  


Categories