I'm working in the CSK 3.1 and I want to hide all the members info from the membership page, for some reason unknown to me (I'm a big nooby at ASP.NET) the email address still show even if the checkbox is marked, so I decided that all the info must be hidden
from view from now on, but I don't know how to do that, can someone please direct me to the page and code where I do that? Please? Any help will be greatly appreciated. P.S. If someone did it already or post it "How" can you place a link please?
Well, thanks for the answers but, last night I couldn't go to sleep so I started doing some trial and error stuff in the members files, and actually it works, I dont know if this is the correct way but, I did some changes in the Member/List.aspx files and
is working fine but if this is not the correct way Zack then I'll post the file you mentioned and do the changes according to you, see the thing is that I needed for the membership page just to show the username NOT the full name of the members and their email
address, so anyway here is what i did in the Members/List.aspx:
Private m_filter
As String
Property Filter()
As String
Get
If m_filter
Is Nothing
Then
Dim o
As Object = ViewState("Filter")
If Not o
Is Nothing
Then
m_filter = CStr(o)
Else
m_filter =
""
End If
End If
Return m_filter
End Get
Set(ByVal value
As String)
ViewState(
"Filter") = value
End Set
End Property
Function linkClass(ByVal letter
As String)
As String
If letter = Filter
Then
Return "selectedLetter"
Else
Return ""
End If
End Function
Protected
Sub showall_Click(ByVal sender
As Object,
ByVal e As System.EventArgs)
Public Function PreFormat(ByVal content
As String)
As String
If Not content
Is Nothing
Then
Return content.Replace(vbCrLf,
"<br/>")
Else
Return Nothing
End If
End Function
Protected
Sub Page_Load(ByVal sender
As Object,
ByVal e As System.EventArgs)
If User.IsInRole("Administrators") =
True Then
manageusers.Visible =
True
sendemail.Visible =
True
Else
manageusers.Visible =
False
sendemail.Visible =
False
End If
End Sub
Public Shared
Function ShowEmail(ByVal provkey
As Object)
As String
If provkey
Is Nothing =
False Then
Try
Return Membership.GetUser(provkey).Email()
Catch ex As Exception
Return ""
End Try
Else
Return ""
End If
End Function
Public Shared
Function Showusername(ByVal provkey
As Object)
As String
If provkey
Is Nothing =
False Then
Try
Return Membership.GetUser(provkey).UserName()
Catch ex As Exception
Return ""
End Try
Else
Return ""
End If
End Function
Sorry I wanted to upload or copy a pic of the results but, as I said I'm a noob and suck at this, anyway what I did was added a public function to show the username and deleted the references for
the other info items. If I figure it out how to paste a pic of the results I will otherwise when is finished I place a link to the site. Thanks
I got it, ok ok it wasn't me it was my daughter, anyway here is the result:
DannyOne
Member
27 Points
16 Posts
How do I hide the membership names and emails?
Feb 06, 2008 05:23 AM|LINK
I'm working in the CSK 3.1 and I want to hide all the members info from the membership page, for some reason unknown to me (I'm a big nooby at ASP.NET) the email address still show even if the checkbox is marked, so I decided that all the info must be hidden from view from now on, but I don't know how to do that, can someone please direct me to the page and code where I do that? Please? Any help will be greatly appreciated. P.S. If someone did it already or post it "How" can you place a link please?
omerkamal
Contributor
2507 Points
513 Posts
Re: How do I hide the membership names and emails?
Feb 06, 2008 08:25 AM|LINK
you can create one more boolean field in your web config e.g
if check box is checked mark it true else false.
later you can decided on this value if email should be shown or not.
zowens
Member
693 Points
243 Posts
Re: How do I hide the membership names and emails?
Feb 06, 2008 10:39 AM|LINK
Can you paste in the code from the Member/Details.aspx file? All you have to do is delete a few lines from that.
Coordinator for the ClubStarterKit (Open Source)
http://codeplex.com/clubstarterkit
DannyOne
Member
27 Points
16 Posts
Re: How do I hide the membership names and emails?
Feb 06, 2008 08:28 PM|LINK
Well, thanks for the answers but, last night I couldn't go to sleep so I started doing some trial and error stuff in the members files, and actually it works, I dont know if this is the correct way but, I did some changes in the Member/List.aspx files and is working fine but if this is not the correct way Zack then I'll post the file you mentioned and do the changes according to you, see the thing is that I needed for the membership page just to show the username NOT the full name of the members and their email address, so anyway here is what i did in the Members/List.aspx:
<%@ Page Language="VB" MasterPageFile="~/Default.master" Title="Members" %><%
@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %><%
@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <%@ Register TagPrefix="Club" TagName="LoginBanner" Src="~/UserControls/LoginBanner.ascx" %><%
@ Register TagPrefix="Club" TagName="ImageThumbnail" Src="~/UserControls/ImageThumbnail.ascx" %><%
@ Register TagPrefix="Club" TagName="WebContent" Src="~/UserControls/WebContent.ascx" %><
script runat="server"> Protected Sub hp1_Click(ByVal sender As Object, ByVal e As System.EventArgs)Filter = CType(sender, LinkButton).TextMemDataSource.SelectParameters(0).DefaultValue = Filter
End Sub
Private m_filter As String Property Filter() As String Get If m_filter Is Nothing Then Dim o As Object = ViewState("Filter") If Not o Is Nothing Then m_filter = CStr(o) Elsem_filter =
"" End If End If Return m_filter End Get Set(ByVal value As String)ViewState(
"Filter") = value End Set End Property
Function linkClass(ByVal letter As String) As String If letter = Filter Then Return "selectedLetter" Else Return "" End If End Function Protected Sub showall_Click(ByVal sender As Object, ByVal e As System.EventArgs)Filter =
""MemDataSource.SelectParameters(0).DefaultValue = Filter
End Sub
Public Function PreFormat(ByVal content As String) As String If Not content Is Nothing Then Return content.Replace(vbCrLf, "<br/>") Else Return Nothing End If End Function Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) If User.IsInRole("Administrators") = True Thenmanageusers.Visible =
Truesendemail.Visible =
True Elsemanageusers.Visible =
Falsesendemail.Visible =
False End If End Sub
Public Shared Function ShowEmail(ByVal provkey As Object) As String If provkey Is Nothing = False Then Try Return Membership.GetUser(provkey).Email() Catch ex As Exception Return "" End Try Else Return "" End If End Function Public Shared Function Showusername(ByVal provkey As Object) As String If provkey Is Nothing = False Then Try Return Membership.GetUser(provkey).UserName() Catch ex As Exception Return "" End Try Else Return "" End If End Function
</script><
asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> <div id="body"> <Club:LoginBanner ID="LoginBanner1" runat="server" /> <div id="columnleft"> <a name="content_start" id="content_start"></a> <div class="leftblock"> <Club:WebContent ID="WebContent1" runat="server" Section="memberlist" />
<Club:RolloverLink ID="edit" runat="server" NavigateURL="~/member/details.aspx" Text="My Details" /> <br /> <Club:RolloverLink ID="manageusers" runat="server" NavigateURL="~/admin/ManageUsers.aspx" Text="Manage Users" /> <Club:RolloverLink runat="server" id="sendemail" text="Send Email" NavigateURL="~/Admin/Email.aspx" />
</div> </div> <div id="columnright"> <div class="rightblock"> <asp:ScriptManager id="ScriptManager1" runat="server"></asp:ScriptManager><asp:UpdatePanel id="UpdatePanel1" runat="server"><contenttemplate> <asp:LinkButton ID="showall" runat="server" Text="Show All" OnClick="showall_Click" /> <asp:ObjectDataSource id="LetersDataSource" runat="server" SelectMethod="ReturnLettersCount" TypeName="ClubStarterKit.Web.Members"></asp:ObjectDataSource> <asp:Repeater DataSourceID="LetersDataSource" ID="Repeater1" runat="server"> <ItemTemplate> <asp:LinkButton ID="hp1" runat="server" Text='<%#Eval("letter")%>' Visible='<%# CInt(Eval("num"))>0 %>' OnClick="hp1_Click" CssClass='<%# LinkClass(CSTR(EVAL("letter")))%>' /> <asp:Label ID="LinkButton1" runat="server" Text='<%#Eval("letter")%>' Visible='<%# CInt(Eval("num"))=0 %>' /> </ItemTemplate> </asp:Repeater> <div class="dashedline"> </div> <asp:ObjectDataSource ID="MemDataSource" runat="server" SelectMethod="Getmembers" TypeName="ClubStarterKit.Web.Members"> <SelectParameters> <asp:Parameter Name="Filter" DefaultValue="" Type="String" /> </SelectParameters> </asp:ObjectDataSource> <asp:DataList ID="DataList1" runat="server" DataSourceID="MemDataSource" RepeatColumns="2" RepeatDirection="Horizontal"> <ItemTemplate> <div class="membercard"> <div style="float: left; padding: 0 5px 0 0;"> <asp:image ID="ImageThumbnail1" runat="server" imageURL='<%# "~\UserControls\AvatarImagefetch.ashx?Memberid=" & Eval("memberid").ToString() %>' />
</div> <h3> <asp:Label ID="Label2" runat="server" Text='<%# Shared_Routines.truncate(Showusername(Eval("memberid")), 28) %>' /> </h3> <div class="clearcard"></div> </div> </ItemTemplate> </asp:DataList> </contenttemplate> </asp:UpdatePanel> <asp:UpdateProgress id="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"> <progresstemplate> <asp:Image ID="Image2" runat="server" SkinID="loading" /> </progresstemplate> </asp:UpdateProgress> </div> </div> <div class="clear2column"></div> </div></
asp:Content>and here are the results:
DannyOne
Member
27 Points
16 Posts
Re: How do I hide the membership names and emails?
Feb 06, 2008 08:39 PM|LINK
Sorry I wanted to upload or copy a pic of the results but, as I said I'm a noob and suck at this, anyway what I did was added a public function to show the username and deleted the references for the other info items. If I figure it out how to paste a pic of the results I will otherwise when is finished I place a link to the site. Thanks
I got it, ok ok it wasn't me it was my daughter, anyway here is the result:
zowens
Member
693 Points
243 Posts
Re: How do I hide the membership names and emails?
Feb 07, 2008 01:18 AM|LINK
Take out this line:
<asp:Label ID="Label2" runat="server" Text='<%# Shared_Routines.truncate(Showusername(Eval("memberid")), 28) %>' />Coordinator for the ClubStarterKit (Open Source)
http://codeplex.com/clubstarterkit