GetUserDetails error Error 27 The name 'IMGUserLabel' does not exist in the current context
- by FBEvo1
I need to get the users name displayed next to the Users picture. The Picture works great however the IMGUserLabel says it not in context. . can you help me solve this?
public void GetUserDetails(int id)
{
string getUserDetail = "Select ID,Email,Name,Country,Convert(varchar (20), RegisterDate, 106) RegisterDate,Convert(varchar (20), LastLogin, 106) LastLogin ,Description,ImageName FROM [User] where Id='" + id + "'";
dt = dbClass.ConnectDataBaseReturnDT(getUserDetail);
if (dt.Rows.Count > 0)
{
IMGUserLabel.Text = dt.Rows[0]["Name"].ToString();
NameLabel.Text = dt.Rows[0]["Name"].ToString();
UserImage.ImageUrl = "~/UserImage/" + dt.Rows[0]["ImageName"].ToString();
lblCreated.Text = dt.Rows[0]["RegisterDate"].ToString();
LabelLastLogin.Text = dt.Rows[0]["LastLogin"].ToString();
lblCreated.Text = dt.Rows[0]["RegisterDate"].ToString();
LabelAboutMe.Text = dt.Rows[0]["Description"].ToString();
}
}
///////////// .Aspx //////////
<a href="<%#GetUserDetails(GetUser(Int Id)%>">
<asp:Label ID="IMGUserLabel" runat="server" Text="Label" Font-Names="Segoe UI"
Font-Size="Larger" ForeColor="White"
src="<%#GetUserDetails(GetUser(Int Id)%>">
</asp:Label>
</a>
he name 'IMGUserLabel' does not exist in the current context?