Hello,

I wanted to know as to how to pass an object of a class with a number of member variables across aspx pages.

i think the items Ramy mentioned are not good. Use cross-page posting or write the data in database and request it on the other page.

there is also server.transfer method which keeps the viewstate. so you can serialize the object in viewstate and the read it in the next page(response.redirect wont work in this scenario, only server.transfer).

but as i said, best is either crosspage posting or using database. just pass the id of that object and grab it from the database in the next page.

Both are not the best way!
1- viewstate not for secure data
2- database not for small objects
Before giving a consulting, ask more questions...

Both are not the best way!
1- viewstate not for secure data
2- database not for small objects
Before giving a consulting, ask more questions...

my best way suggession do not include first item. i said either crosspage posting or database. last year i work in Turkey's biggest e-commerce web application with over milion visits a day. We used to write everything to database. i dont know your experiences though :)

Ramy the competitor Mahrous :)

This article has been dead for over six months. Start a new discussion instead.