Hi, hope you can help me
I have a gridview which contains a button and a label
When i click the button (lnkBtnEdit) i want to redirect to another page with the button (lnkBtnEdit) and label (lblSlideUrl) values.
I can get the buttons (lnkBtnEdit) value no problem but I cannot get the label (lblSlideUrl) value. I have tried using findcontrol but i keep getting errors.
Any surgestions on how to get the labels value.
Many Thanks
AnnieX
<!--Webpage-->
<asp:GridView ID="gvSlides"
runat="server"
Width="100%"
AutoGenerateColumns="False"
HeaderStyle-CssClass="NCT-H9-BK-B"
HorizontalAlign="Center"
BorderStyle="Solid"
BorderWidth="0px"
BorderColor="#CCCCCC"
CellPadding="2"
CellSpacing="2">
<Columns>
<asp:TemplateField HeaderText="Slide Url">
<ItemTemplate>
<asp:Label ID="lblSlideUrl" runat="server" Text='<%# Eval("SlideUrl")%>' CssClass="NCT-H9-BK"></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" VerticalAlign="Bottom" Width="30%" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Edit">
<ItemTemplate>
<asp:LinkButton ID="lnkBtnEdit" CommandName="lnkBtnEdit" CommandArgument='<%#DataBinder.Eval(Container.DataItem, "IDtblSlide")%>' runat="server" CausesValidation="false">Edit</asp:LinkButton>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Right" Width="5%" />
<ItemStyle HorizontalAlign="Right" CssClass="NCT-H9-BK" />
</asp:TemplateField>
</Columns>
<RowStyle BackColor="#E5F4FF" />
<AlternatingRowStyle BackColor="#E0E0E0" />
<HeaderStyle CssClass="NCT-H9-BK-B" BackColor="LightGray"></HeaderStyle>
</asp:GridView>
<!--Code behind-->
Protected Sub gvSlides_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gvSlides.RowCommand
If e.CommandName = "lnkBtnEdit" Then
Dim varRowID As String = e.CommandArgument
''''''''What would i write here to get the value of the label in this row
Response.Redirect("Index.aspx?varRowID=" & varRowID & "&Url=" & Url, False)
End If
End Sub