Hi,
I am post form data from, say, source.aspx to destination.aspx page. The source.aspx page has some checkboxes which are used in a SQL query in the destination.aspx page. For example,
if (Request.Form["color_spice"] != null) { WhereClause += " OR ado_products_fabrics.color = 'spice'"; }
The first time the destination page loads the RadListView shows the pagination fine. However, clicking on the RadDataPager under the RadListView causes a postback where the source.aspx page's Form data are lost. I have tried using PreviousPage.FindControl() method but that too does not resolve in the pagination's postback.
So what can I do? I don't want to use Session variables--there are going to be dozens of controls from the source.aspx page passing values to destination.aspx page. Cookies too will be too much to track then?
Below are the code-fragments for the .aspx and the .cs files.
Thanks!
I am post form data from, say, source.aspx to destination.aspx page. The source.aspx page has some checkboxes which are used in a SQL query in the destination.aspx page. For example,
if (Request.Form["color_spice"] != null) { WhereClause += " OR ado_products_fabrics.color = 'spice'"; }
The first time the destination page loads the RadListView shows the pagination fine. However, clicking on the RadDataPager under the RadListView causes a postback where the source.aspx page's Form data are lost. I have tried using PreviousPage.FindControl() method but that too does not resolve in the pagination's postback.
So what can I do? I don't want to use Session variables--there are going to be dozens of controls from the source.aspx page passing values to destination.aspx page. Cookies too will be too much to track then?
Below are the code-fragments for the .aspx and the .cs files.
Thanks!
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadListView1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"ListViewPanel1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
div
style
=
"width: 880"
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
Skin
=
"Black"
>
</
telerik:RadAjaxLoadingPanel
>
<
asp:Panel
ID
=
"ListViewPanel1"
runat
=
"server"
>
<
telerik:RadListView
ID
=
"RadListView1"
runat
=
"server"
DataKeyNames
=
"fabricid"
AllowPaging
=
"True"
>
<
LayoutTemplate
>
<
div
class
=
"RadListView RadListViewFloated RadListView_Default"
>
<
div
class
=
"rlvFloated"
>
<
div
id
=
"itemPlaceholder"
runat
=
"server"
>
</
div
>
</
div
>
</
div
>
<
telerik:RadDataPager
ID
=
"RadDataPager1"
runat
=
"server"
PagedControlID
=
"RadListView1"
>
<
Fields
>
<
telerik:RadDataPagerButtonField
FieldType
=
"Numeric"
/>
</
Fields
>
</
telerik:RadDataPager
>
</
LayoutTemplate
>
.....
protected void Page_Load(object sender, EventArgs e)
{
String WhereClause = string.Empty;
//determine which button clicked http://stackoverflow.com/questions/1099020/asp-net-cross-page-posting
if (Request.Form["btnTextGeneric"] != null)
{
// do button 1 stuff
}
else if (Request.Form["btnCBFabrics"] != null)
{
/////COLORS
if (Request.Form["color_spice"] != null) { WhereClause += " OR ado_products_fabrics.color = 'spice'"; }
.....
if (WhereClause != "")
{
RadListView1.DataSource = GetDataTable("SELECT * FROM [ado_products_fabrics] WHERE 0 = 1" + WhereClause);
}
else
{
RadListView1.DataSource = GetDataTable("SELECT * FROM [ado_products_fabrics]");
}
RadListView1.DataBind();