Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / March 2006

Tip: Looking for answers? Try searching our database.

Page state on postback

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bdgreen@pacbell.net - 22 Mar 2006 05:03 GMT
Hi,

This is a pretty straightforward question about postback, etc. in C#
ASP.NET.

I have 3 DropDownLists, each is bound to a SQL DataTable, created from
3 SQL queries.  If the user makes a selection from a DropDownList, an
auto-postback event is triggered.  But, the DataTables, which are
members of my Page class, become null on the postback.  I don't want to
lose that DataTable information.  There's more info in the DataTables
than the DropDownLists, which is why I want to keep them around.

So, does this mean I need to recreate the DataTables somehow and rebind
, such as repeating the SQL queries and rebinding, or serializing the
data somehow?

I'm just trying to figure out the limits of what .net does for me.  Is
it limited to setting the state of controls on postback?  I'm aware of
how Session["var"] and ViewState["var"] work, I just wanted to see if
I'm overlooking something, like some trick to keep variables in the
Page class around between postbacks.

At this point it seems like caching the SQL queries to recreate to
DataTables is my best bet.  Lemme know if I'm missing something.

Thanks in advance
bdgreen@pacbell.net - 27 Mar 2006 09:39 GMT
no replies?  heh, I thought this was an easy one. I'll try to summarize
the question... Is there a way to hang onto some data  (i.e. members
variables of the derived Page class) in between postbacks, other than
the standard get/post variables and the controls tied to them? (And
other than session/viewstate/cookie storage)

I realize that HTTP is stateless, I'm just wondering if .net bridged
the gap between desktop and web applications enough to hang onto
variables for each user/session.

thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.