-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when getting User info from Separate table in foreach loop #35
Labels
Comments
Help Please.... |
Same Error in GridView
< ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateColumns="false" SelectMethod="BindUsers">
|
I think you need to eager load the UserProfileInfo using
|
@ctolkien it looks solution, but i am not getting the correct syntax for Include...
private UserManager manager;
public List allUser;
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I want to Show all Users on a Page. I am storing Profile info in a Separate table called UserProfileInfo. All is working ok. In a foreach loop when I get the FirstName or other fields stored in UserProfileInfo table it give error all the time in WebForms Application...
Here is my code
public class ApplicationUser : IdentityUser
{
public virtual UserProfileInfo UserProfileInfo { get; set; }
}
public class UserProfileInfo
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
WebForm Code Behind to Load all Users
private ApplicationDbContext context;
private UserManager manager;
public List allUser;
Error
An exception of type 'System.NullReferenceException' occurred in App_Web_4cfuyuel.dll but was not handled in user code
Need help...
The text was updated successfully, but these errors were encountered: