Hello,
I have label control inside of gridview row, but I cannot seem to find to find any of them in the serverside window. The labels have runat="server" attribute, but not recognised. The name does not exist in the current context.
<asp:GridView ID="Gridview2" runat="server" Font-Size="10pt" HeaderStyle-Font-Size="10pt" CellPadding="6" GridLines="None" ShowFooter="True" AutoGenerateColumns="False" HeaderStyle-Font-Bold="false"
Style="width: 100%" FooterStyle-BackColor="#fdfdfd" HeaderStyle-ForeColor="#000000" Height="50px" HeaderStyle-Height="10px">
<Columns>
<asp:TemplateField HeaderText="Column1" ItemStyle-Width="40%" HeaderStyle-Font-Bold="false">
<ItemTemplate>
<asp:TextBox ID="textBox1" runat="server" Class="form-control" Width="100%" Font-Size="10pt" Style="overflow: hidden; text-transform: capitalize; resize: none;" oninput="Resize(this)" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Column2" ItemStyle-Width="10%" HeaderStyle-Font-Bold="false">
<ItemTemplate>
<asp:TextBox CssClass="form-control" ID="txtQuantity" Font-Size="10pt" runat="server" Width="100%" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Column3" ItemStyle-Width="25%" HeaderStyle-Font-Bold="false">
<ItemTemplate>
<asp:Label runat="server" ID="hero-lbl" Style="font-weight: 400;"></asp:Label>
<asp:TextBox ID="TxtBx" runat="server" Font-Size="10pt" Width="90%" placeholder="0.00" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Column4" ItemStyle-Width="50%" HeaderStyle-Font-Bold="false">
<ItemTemplate>
<asp:Label class="c-info" runat="server" ID="Infolabel" Style="font-weight: 400;"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:DropDownList ID="DropDown1" runat="server" CssClass="form-control"
AutoPostBack="true" OnSelectedIndexChanged="SelectedIndexChanged">
</asp:DropDownList>
protected void SelectedIndexChanged(object sender, EventArgs e)
{
LabelSymbol.Text = DropDown1.SelectedItem.Value.ToString();
DropDown1.SelectedItem.Text = DropDown1.SelectedItem.Text.ToString();
hero-lbl.Text = DropDown1.SelectedItem.Value.ToString();
Infolabel.Text = DropDown1.SelectedItem.Value.ToString();
}