“Compiler Error Message: CS0103: The name ‘EmailTB’ does not exist “
I wanted to display an email value in the EmailTB text control via ListView control, using this syntax below:
<div class="form_right_view">
<asp:Label ID="EmailTB" runat="server" Text='<%# Eval("Email") %>' CssClass="" Font-Bold="true"></asp:Label>
</div>
But when I try to use the value of the EmailTB.text in the code behind using this:
if (EmailTB.Text != " ")
{
string Username = Group.GetUserNameByEmail(EmailTB.Text);
}
I get the error: “Compiler Error Message: CS0103: The name 'EmailTB' does not exist in the current context.” Please help me fix this. Thanks!