Greetings everyone.
Let me explain my current situation:
I have a search page where users can select a product from a drop-down list, and upon clicking a button, a gridview is displayed showing the specifications of the selected product.
What I'm aiming for is to have a functionality where when a user makes their selection, a new window pops up with the detailed specs.
Here's the simple code behind for the search page:
protected void Button1_Click(object sender, EventArgs e)
{
Session["Product"] = DropDownList1.SelectedValue;
string strScript = "window.open('GridViewPage.aspx', 'Key', 'height=500,width=800,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,titlebar=no');";
ScriptManager.RegisterStartupScript(this, typeof(string), "", strScript, true);
}
And then on the GridView page, the data is presented based on the session created in the search page:
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
DataSourceID="LinqDataSource1">
<Columns>
<asp:BoundField DataField="Product" HeaderText="Product"
SortExpression="Product" />
<asp:BoundField DataField="Spec" HeaderText="Spec"
SortExpression="Spec" />
</Columns>
</asp:GridView>
<asp:LinqDataSource ID="LinqDataSource1" runat="server"
ContextTypeName="GridViewInNewWindow.ProductDataContext" EntityTypeName=""
TableName="tblProducts" Where="Product == @Product">
<WhereParameters>
<asp:SessionParameter Name="Product" SessionField="Product"
Type="String" />
</WhereParameters>
</asp:LinqDataSource>
Initially, this setup works well as it opens the gridview in a new window. For example, if a user searches for "egg", the spec for an egg is shown in a new window.
However, what I want is for the user to be able to make multiple searches, so that multiple new windows are opened. For instance, if a user first searches for "egg" and sees its spec in a new window, they should then be able to search for "chicken", click the button, and another new window should display the specs for chicken.
Is there a way to achieve this? I apologize if this is basic, I am still learning.