Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying Profile Values.

Status
Not open for further replies.

rahulpatel

Programmer
Jan 20, 2007
33
AU
I've done some searching but can't place the answer to my problem.
I've created a website for a local group. They create accounts and an log in, update profiles and log out etc. I want to allow guest visitors to view members profiles but I cannot work out how to do this. If I use a grid view or a details view, the profile column displays everything in one column.

Does anyone know how I can show individual members details fairly easily. I've tried drop down lists and labels, gridviews and detailviews but nothing seems to work.

Any pointers would be gratefully received.

Thanks
 
if you can get the data, parse the data manually into an object you can use for display purposes. then create a List<MyProfile> of all the users.

then bind this list to a grid.
Code:
color green]//note this class is read only.  to modify the public properties uncomment the set statement[/color]
public class MyProfile
{
  private string, firstName, lastName, userName;
  public string FirstName
  {
      get { return this.firstName; }
      [COLOR=green]//set { this.firstName = value; }[/color]

  }
  public string LastName
  {
      get { return this.lastName; }
      [COLOR=green]//set { this.lastName = value; }[/color]

  }
  public string UserName
  {
      get { return this.userName; }
      [COLOR=green]//set { this.userName = value; }[/color]

  }
  public MyProfile(ProfileObject profile)
  {
     [COLOR=green]/*parse profile object into fields: example:
        this.firstName = profile.FirstName;
        this.lastName = profile.lastName;
        this.userName = profile.UserName;
        obviously it's not this simple, or you wouldn't need this object, but you get the idea.
*/[/color]
  }
}

then load the profiles for a grid.
Code:
List<MyProfiles> profiles = new List<MyProfiles>();
foreach(ProfileObject profile in [GetProfiles from asp.net])
{
    profiles.Add(new MyProfile(profile);
}

MyDataGrid.DataSource = profiles;
MyDataGrid.DataBind();

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top