locked
Is there a way to hide empty membercards? RRS feed

  • Question

  • User415390980 posted
    I have my site set so that everyone can decide what they want made public in the member_list.aspx page, but even if all of their fields are empty, it still shows 150 empty member cards. There's two things I don't like about that. 1-It's ugly. 2-It takes up a lot of space for no reason. Is there a way to set things so that if all of the labels in the membercard are empty it doesn't show that membercard at all? If I need to, I'll just come up with a new way to do a member directory, but I really like the way this starter kit has it set up, so I'd like to use it if possible. Any help anyone?
    Friday, October 27, 2006 10:46 PM

Answers

  • User1812216987 posted

    ok, try this. Open up your DataSet.xsd file located in the App_Code directory. Select the GetMemberList() in the diagram. In the properties choose the CommandText and click the ... button. The Query Builder should open up with this select query: SELECT     memberid, address, phone, firstname, lastname, DATALENGTH(avatar) AS AvatarSize FROM         MemberInfo.

    At the end add this: WHERE Len(address)>0 or Len(phone) > 0 or Len(firstname) > 0 or Len(lastname) > 0

    Let me know if that works.

    allan

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 9, 2006 1:46 PM

All replies

  • User1812216987 posted

    Change the select statement in GetMemberList to just return the ones that have any of the fields nonempty.

     allan

    Tuesday, October 31, 2006 4:47 AM
  • User415390980 posted
    I'm still learning this whole ASP.NET and SQL stuff, so how do I go about doing that?
    Thursday, November 9, 2006 12:05 PM
  • User1812216987 posted

    Before I answer that I need to know how you go about letting the users decide what info is public or not? Just by not entering any information in the fields or is it something else?

    allan

    Thursday, November 9, 2006 12:39 PM
  • User415390980 posted
    They just leave fields blank on the Member_Details page for the items they don't want made public.
    Thursday, November 9, 2006 12:51 PM
  • User1812216987 posted

    ok, try this. Open up your DataSet.xsd file located in the App_Code directory. Select the GetMemberList() in the diagram. In the properties choose the CommandText and click the ... button. The Query Builder should open up with this select query: SELECT     memberid, address, phone, firstname, lastname, DATALENGTH(avatar) AS AvatarSize FROM         MemberInfo.

    At the end add this: WHERE Len(address)>0 or Len(phone) > 0 or Len(firstname) > 0 or Len(lastname) > 0

    Let me know if that works.

    allan

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 9, 2006 1:46 PM
  • User415390980 posted
    Awesome I'll give that a try. :)
    Thursday, November 9, 2006 2:43 PM
  • User415390980 posted

    You, my friend, are awesome. It worked like a charm. Thank you SO MUCH!!!

    Thursday, November 9, 2006 3:01 PM
  • User1812216987 posted

    I'm happy to assist[Yes]

    allan

    Thursday, November 9, 2006 3:12 PM