I have page "PictureLotFiles.aspx" that contains a CheckBoxList and a link(originally a hyperlink, but it doesn't work for me since it will not save the Session for me).
PicturesLotFiles.aspx
<asp:CheckBoxList ID="cblWarehouse" runat="server" Font-Size="10pt" Font-Names="Verdana"
RepeatColumns="8" RepeatDirection="Horizontal" OnSelectedIndexChanged="cblWarehouse_SelectedIndexChanged">
</asp:CheckBoxList>
<asp:LinkButton ID="lnkBtnSummary" runat="server" OnClick="lnkBtnSummary_Click"
Target="_blank">Review Lot Pictures Summary Report</asp:LinkButton>
What I am trying to accomplish is to pass the selected value(s) from cblWarehouse to the summary page "PictureLotFilesSummary.aspx". So I have the following codebehind working.
PicturesLotFiles.aspx.cs
protected void lnkBtnSummary_Click(object sender, System.EventArgs e)
{
Session["WarehouseSelected"] = "";
StringBuilder sb = new StringBuilder();
foreach (ListItem listItem in cblWarehouse.Items)
{
if (listItem.Selected)
{
sb.Append(listItem.Value);
sb.Append(", ");
}
}
if (sb.Length>2)
sb.Remove(sb.Length - 2, 2);
Session["WarehouseSelected"] = sb;
//Response.Write("<SCRIPT language=\"javascript\">open('PicturesLotFilesSummary.aspx','_blank','top=0,left=0,status=yes,resizable=yes,scrollbars=yes');</script>");
//Response.Redirect("~/PicturesLotFilesSummary.aspx");
}
From my code above I was able to pass the values using Session, but I have not tried QueryString yet. I have commented out the last two line since one of it opens a new pop up window, and the other one simply redirect to the page.
Is there any other way I can try to accomplish my goal? Which is pass the values selected to the summary page and open it in the new tabs instead of new window? Thanks!