B
bdgreen
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
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