Note that there are some explanatory texts on larger screens.

plurals
  1. POThe name "'IMGUserLabel' does not exist in the current context"
    text
    copied!<p>This is where the IMGUserlabel is located at in the .Apsx :</p> <p><img src="https://i.stack.imgur.com/2TYDV.png" alt="enter image description here"></p> <p>This is the Aspx.Cs : </p> <pre><code>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 &gt; 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(); } } </code></pre> <p>And The Error is Displayed : The name "'IMGUserLabel' does not exist in the current context" However the other labels display the data correctly</p> <p>Ok i have added this, And there is no Errors :) however no data is being displayed on the Label , it just says "Label" :</p> <pre><code>void Item_Bound(Object sender, DataListItemEventArgs e) { 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='" + e + "'"; { // Retrieve the Label control in the current DataListItem. Label IMGUserLabel = (Label)e.Item.FindControl("IMGUserLabel"); IMGUserLabel.Text = dt.Rows[0]["Name"].ToString(); } } </code></pre> <p>This is the Result , label is supposed to display the user of that image <img src="https://i.stack.imgur.com/0gyH7.png" alt="enter image description here"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload