BOEING39
asked on
GRIDVIEW HYPERLINK
I have a GridView page named "Home1All" that has a "Hyperlink" Column named "UpLoad View".
This hyperlink directs the user to a new page "FileUpload1/Default.aspx"
The Default page contains another GridView which does displays properly; however, I need help in establishing a filter on the 2nd GridView based on a value from the 1st namely "Ship".
So when When the Hyperlink is clicked I need the corresponding value for "Ship" to be passed to the 2nd Gridview Querry so that the 2nd GridView only displays all data pertaining to that Ship #.
GRIDVIEW #1 (Sniplet #1) Home1All Hyperlink
GRIDVIEW #2: (Sniplet#2) FileUpload1/Default.aspx Hyperlinked Page, Displaying specific Ship# data based on respective ship number associated with "Home1All" GridView row.
This hyperlink directs the user to a new page "FileUpload1/Default.aspx"
The Default page contains another GridView which does displays properly; however, I need help in establishing a filter on the 2nd GridView based on a value from the 1st namely "Ship".
So when When the Hyperlink is clicked I need the corresponding value for "Ship" to be passed to the 2nd Gridview Querry so that the 2nd GridView only displays all data pertaining to that Ship #.
GRIDVIEW #1 (Sniplet #1) Home1All Hyperlink
GRIDVIEW #2: (Sniplet#2) FileUpload1/Default.aspx Hyperlinked Page, Displaying specific Ship# data based on respective ship number associated with "Home1All" GridView row.
<asp:hyperlinkfield DataNavigateUrlFormatString="FileUpload1/Default.aspx" NavigateUrl="../FileUpload1/Default.aspx" Text="Docs" HeaderText="Upload View">
<ControlStyle ForeColor="Blue" />
<HeaderStyle HorizontalAlign="Center" Wrap="True" Width="35px" />
<ItemStyle HorizontalAlign="Center" Wrap="False" Width="35px" />
</asp:hyperlinkfield>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
ConnectionString="<%$ ConnectionStrings:AllegiantMXConnectionString %>"
DeleteCommand="DELETE FROM [fileDet] WHERE [ID] = @ID"
InsertCommand="INSERT INTO [fileDet] ([fname], [fpath], [desc1], [Ship], [Dates], [Sta]) VALUES (@fname, @fpath, @desc1, @Ship, @Dates, @Sta)"
SelectCommand="SELECT * FROM [fileDet] ORDER BY [Dates] DESC"
UpdateCommand="UPDATE [fileDet] SET [fname] = @fname, [fpath] = @fpath, [desc1] = @desc1, [Ship] = @Ship, [Dates] = @Dates, [Sta] = @Sta WHERE [ID] = @ID">
<DeleteParameters>
<asp:Parameter Name="ID" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="fname" Type="String" />
<asp:Parameter Name="fpath" Type="String" />
<asp:Parameter Name="desc1" Type="String" />
<asp:Parameter Name="Ship" Type="String" />
<asp:Parameter Name="Dates" Type="String" />
<asp:Parameter Name="Sta" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="fname" Type="String" />
<asp:Parameter Name="fpath" Type="String" />
<asp:Parameter Name="desc1" Type="String" />
<asp:Parameter Name="Ship" Type="String" />
<asp:Parameter Name="Dates" Type="String" />
<asp:Parameter Name="Sta" Type="String" />
<asp:Parameter Name="ID" Type="Int32" />
</UpdateParameters>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Can you provide an example with the code I have provided?
ASKER
Agar, I utilized your references to come up with the solution passing the query based on "Ship" @ {0} on to the 2nd page. Thanks.
On my source page, this is my button code where I get the values from the two dropdowns and form a url to open my detail page.
Open in new window
On the destination page I have two labels which show the Ship and delivery date I selected in the source page. These could be hidden, but I think it's alaways good to see the parent details when one drills down to detal.
Open in new window
In the code behind on the destination page, I have the following -
Open in new window
The ListView on the desination page shows the detail of the ship and date I selected because its select parameters use the two labels as controlparameters when selecting the shipment details.
I hope this is of some use to you.