populate label with control id

47 views Asked by At
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="audition_ID" DataSourceID="ObjectDataSource10" AllowPaging="True" AllowSorting="True">
                    <Columns>
                        <asp:BoundField DataField="audition_ID" HeaderText="audition_ID" InsertVisible="False" ReadOnly="True" SortExpression="audition_ID" />
                        <asp:BoundField DataField="audition_date" HeaderText="audition_date" SortExpression="audition_date" />
                        <asp:BoundField DataField="ins_ID" HeaderText="ins_ID" SortExpression="ins_ID" />
                        <asp:BoundField DataField="insturment_name" HeaderText="insturment_name" SortExpression="insturment_name" />
                        <asp:BoundField DataField="audition_status" HeaderText="audition_status" SortExpression="audition_status" />
                        <asp:BoundField DataField="audition_location" HeaderText="audition_location" SortExpression="audition_location" />
                        <asp:BoundField DataField="audition_time" HeaderText="audition_time" SortExpression="audition_time" />
                        <asp:HyperLinkField DataNavigateUrlFields="audition_ID" DataNavigateUrlFormatString="judgescores.aspx?auditionID={0}" HeaderText="Details" Text="Details" />
                    </Columns>
                </asp:GridView>

I am using a grid view to display information for a database based on the selection in a drop down list. I have that working and when selecting the DDL- the grid view updates and shows the associated records.

I then added a "Details" hyperlink column that directs to the details.aspx page and picks up the ID so it shows the correct details associated with that record.

DataNavigateURLFormat = details.aspx?ID={0}

I can see the ID in the URL od this details page. What I am trying to do now is take that ID and populate it in a label on the details page.

I am exploring the "Expression" property in the Data section of the label properties- but have not found any luck using "AccessControlID" or "ClientIDMode" giving it a "RouteValue".

I was also exploring going in the code of the details page (details.aspx.vb)

and doing something like

lbldetail.Text = @ID

But not sure if that would work.

Any help would be greatly appreciated.

Contents of judgescores.aspx.vb page...

Partial Class Judges_judgescores
Inherits System.Web.UI.Page
Sub Page_Load()

   lblCurrentAudition.Text = Request.QueryString[audition_ID]
End Sub
0

There are 0 answers