How do you manage members once your site is hosted?

Rate It (3)

Last post 09-08-2009 11:53 PM by learner01. 39 replies.

Sort Posts:

  • How do you manage members once your site is hosted?

    09-21-2006, 3:52 PM
    • Participant
      1,837 point Participant
    • voodoo9055
    • Member since 12-04-2003, 12:36 AM
    • Atlanta, GA
    • Posts 429
    Right now, I am using the web administration tool on my local machine.  How would I do this on my host?
  • Re: How do you manage members once your site is hosted?

    09-22-2006, 10:49 AM
    • Member
      417 point Member
    • tonsai
    • Member since 09-06-2006, 3:40 PM
    • Posts 89
    As far as I know there is no user management page. If you log in as admin there is no user management link.

    I want to let users add and removes ads as they wish without approving all (can you imagine if it actually becomes a popular site). Or if someone makes a complaint about the content of an ad I'd like to be able to suspend or delete not just the ad but the user account.

    Also, would be nice if there was a limit setting for how many ads a user can post? This is one thing I'd like to add in. This way I could limit it to say 1 or 2 ads for free per account. If a user wants to add 10, 20, 30 + ads (and estate agent for example) they would have to purchase an account.
    Custom Classifieds Site: http://tinyurl.com/3ybh5k
  • Re: How do you manage members once your site is hosted?

    09-22-2006, 10:56 AM
    • Contributor
      3,017 point Contributor
    • paggy4u
    • Member since 05-19-2004, 7:29 AM
    • Posts 774

    tonsai:


    Also, would be nice if there was a limit setting for how many ads a user can post? This is one thing I'd like to add in. This way I could limit it to say 1 or 2 ads for free per account. If a user wants to add 10, 20, 30 + ads (and estate agent for example) they would have to purchase an account.

     

    Yes....
    Thas a great solution, to offer ads in limit, As a  free members one can post few ads only, rather than keep on posting frequently.
    PLUS... there should be a way, when an advt comes again for approval after being edited by member.

    Currently if the admin approves the advt, it goes live. In case the member edits it again, with a ABUSIVE stuff, the admin will never come to kow, since the advt does not come for approval again.

    The advt should come for approval in case of diting the matter or uploading the new photo as well. ABUSIVE  photos can also be uploaded>

    This is a very serious matter.

    (1) Limiting the ads and Approval, both are required for a successful classified site.

    Thanks

    Paggy4u
    -----------------------------------------
    Working with Dynamic Languages
  • Re: How do you manage members once your site is hosted?

    09-22-2006, 1:28 PM
    • Participant
      1,837 point Participant
    • voodoo9055
    • Member since 12-04-2003, 12:36 AM
    • Atlanta, GA
    • Posts 429

    As far as I know there is no user management page. If you log in as admin there is no user management link.

     I guess I will have to build my own.


    I want to let users add and removes ads as they wish without approving all (can you imagine if it actually becomes a popular site).

    This feature is already included in the administration site settings as:

    Ads require activation before appearing on the site:

     

    Or if someone makes a complaint about the content of an ad I'd like to be able to suspend or delete not just the ad but the user account.

    This is a feature I am planning to create once I figure out how to get the site running properly on my host.  I am going to put a "Report Spam" link on ads.  That is a good ideal to add an option to delete the account as well.

  • Re: How do you manage members once your site is hosted?

    09-28-2006, 8:05 AM
    • Member
      58 point Member
    • gettinlucky
    • Member since 05-23-2006, 5:12 PM
    • Kalamazoo
    • Posts 50

    Well as far as managing the users on the site, I have found this demo to work and I just integrated it into my existing site. Needs some work to but it is functional.

    http://www.dotnetbips.com/articles/displayarticle.aspx?id=509 

    It contains a "role manager" but I’m sure has endless possibilities. Something I’m going to work on adding is the ability for it to 'enable' and 'disable' accounts. Rather than deleting a user just disable them. I mean if you cannot login it's the same as being deleted, right?

    Not sure if the site already contains something like this in Admin area but I’m sure it could be integrated in if need be.

    Hope this help's,
    Tim

     

  • Re: How do you manage members once your site is hosted?

    09-28-2006, 8:32 AM
    • Participant
      1,837 point Participant
    • voodoo9055
    • Member since 12-04-2003, 12:36 AM
    • Atlanta, GA
    • Posts 429

    I have since found this guys site.  His member/role management tool has saved me a lot of time.

    I just included as part of the Admin section.  Go to the Download Manager to see the tools.

     http://peterkellner.net/

  • Re: How do you manage members once your site is hosted?

    09-28-2006, 4:09 PM
    • Member
      417 point Member
    • tonsai
    • Member since 09-06-2006, 3:40 PM
    • Posts 89

    Hi Voodoo, have you actually got it working. are you using the VB version of the Classified Kit.

    Are yoiu using SQLServer 2000.

    Could you give some details as to how you implemented it.

    Where did you copy the files from the kit to.

    What changes did you make to your web.config in order to tget it to work.

    Custom Classifieds Site: http://tinyurl.com/3ybh5k
  • Re: How do you manage members once your site is hosted?

    09-28-2006, 4:26 PM
    • Participant
      1,837 point Participant
    • voodoo9055
    • Member since 12-04-2003, 12:36 AM
    • Atlanta, GA
    • Posts 429
    tonsai:

    Hi Voodoo, have you actually got it working. are you using the VB version of the Classified Kit.

    Are yoiu using SQLServer 2000.

    Could you give some details as to how you implemented it.

    Where did you copy the files from the kit to.

    What changes did you make to your web.config in order to tget it to work.

     I am using the default SQL Express that comes with the Classified Starter Kit.

     Go to his website. 

     http://peterkellner.net/zdm_1_2/index.php

     Download MembershipEditor7.zip and implement what you need.   Also, Membership1.zip has a newer interface.  Review the code to strategize how you want to add this to your administration area.  I just added the files I need and made a link from the Admin default page to my Members.aspx file.

     It works pretty well when it comes to managing members and roles on the ASPNETDB database.  You will have to add some code to make sure that members are added and remove properly in your CLASSIFIEDSDB.

  • Re: How do you manage members once your site is hosted?

    04-15-2007, 12:57 PM
    • Member
      24 point Member
    • jroal
    • Member since 04-12-2007, 10:50 PM
    • Chillicothe, IL
    • Posts 15
    I wrote a user tool but I don't have permission to upload it here.
    http://www.jimroal.com/
  • Re: How do you manage members once your site is hosted?

    04-29-2007, 10:19 AM
    • Member
      24 point Member
    • jroal
    • Member since 04-12-2007, 10:50 PM
    • Chillicothe, IL
    • Posts 15

    Ad these files to your admin directory

    http://home.mchsi.com/~j.roal/Users.zip

    Compile and go.  

     File: Users.aspx

    <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" CodeFile="Users.aspx.cs"
    	Inherits="Users" Title="Manage Users" %>
    
    <asp:Content ID="MainContent" ContentPlaceHolderID="Main" runat="server">
    	<div id="body">
    		<div id="col_main_left">
    			<div id="user_assistance">
    				<a id="content_start"></a>
    				<h3>
    					Actions</h3>
    				<p>Use this section to change user roles or delete users.  Note: deleting users is not reverisible!  
    				They will need to sign up again to become a user again.</p>	
    				<p>
    					<asp:HyperLink ID="BackToAdminLink" runat="server" NavigateUrl="~/Admin/Default.aspx">back to Administration</asp:HyperLink></p>
    			</div>
    		</div>
    		<div id="col_main_right">
    			<h2 class="section">
    				User Administration</h2>
    			<div class="content_right">
    				<fieldset>
                        <asp:Label ID="Label1" runat="server" Font-Bold="True" Text="Select a user from the list"></asp:Label>
                        <p>
                        <asp:ListBox ID="ListBox1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ListBox1_SelectedIndexChanged"
                            Width="80%"></asp:ListBox></p><p>
                        
                        <asp:Label ID="Label4" runat="server" Font-Bold="True" Text="Name:"></asp:Label>
                        </p><p>
                        <asp:Label ID="Label3" runat="server" Font-Bold="True" Text="Email:"></asp:Label>
                        </p><p>
                        <asp:Label ID="Label6" runat="server" Text=" "></asp:Label>
                        </p>
                        <asp:Label ID="Label2" runat="server" Font-Bold="True" Text="Roles :"></asp:Label>
                        <asp:CheckBoxList ID="CheckBoxList1" runat="server" AutoPostBack="True"></asp:CheckBoxList>
                        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Update Roles" />
                        <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Delete User" />
                        <asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="Unlock User" />
                        <asp:Button ID="Button4" runat="server" OnClick="Button4_Click" Text="Approve User" />
                    </fieldset>
    			</div>
    		</div>
    	</div>
    </asp:Content>
    

      

     File: Users.aspx.cs

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    
    public partial class Users : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                MembershipUserCollection users = Membership.GetAllUsers();
                foreach (MembershipUser user in users)
                {
                    ListBox1.Items.Add(user.UserName);
                }
                string[] allRoles = Roles.GetAllRoles();
                foreach (string role in allRoles)
                {
                    CheckBoxList1.Items.Add(role);
                }
                Button1.Enabled = false;
                Button2.Enabled = false;
                Button3.Enabled = false;
                Button4.Enabled = false;
                Label3.Visible = false;
                Label4.Visible = false;
                // Bind users to ListBox.
                ListBox1.DataSource = users;
                ListBox1.DataBind();
            }
        }
        protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            //Clean up the list box first
            string[] allRoles = Roles.GetAllRoles();
            foreach (string role in allRoles)
            {
                ListItem li = CheckBoxList1.Items.FindByValue(role);
                li.Selected = false;
            }
            //now add the right checks
            string[] userRoles = Roles.GetRolesForUser(ListBox1.SelectedValue);
            foreach (string role in userRoles)
            {
                ListItem li = CheckBoxList1.Items.FindByValue(role);
                if (li != null)
                {
                    li.Selected = true;
                }
                Button1.Enabled = true;
                Button2.Enabled = true;
                Label3.Visible = true;
                Label4.Visible = true;
                MembershipUser userselected = Membership.GetUser(ListBox1.SelectedValue);
                Label4.Text = "Name: " + Profile.GetProfile(ListBox1.SelectedValue).FirstName + " " + Profile.GetProfile(ListBox1.SelectedValue).LastName;
                Label3.Text = "Email: " + userselected.Email;
                if (userselected.IsLockedOut)
                {
                    Button3.Enabled = true;
    
                }
                else
                {
                    Button3.Enabled = false;
    
                }
                if (userselected.IsApproved)
                {
                    Button4.Enabled = true;
                    Button4.Text = "Disapprove User";
                }
                else
                {
                    Button4.Enabled = true;
                    Button4.Text = "Approve User";
                }
                if (userselected.IsOnline)
                {
                //    Label6.Text = "Online Now"; Not working at the moment
                }
                else
                {
                 //   Label6.Text = "Offline";
                }
               // Label6.Text =  Convert.ToString(userselected.LastActivityDate);
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            foreach (ListItem li in CheckBoxList1.Items)
            {
                if (li.Selected == true)
                {
                    if (Roles.IsUserInRole(ListBox1.SelectedValue, li.Value) == false)
                    {
                        Roles.AddUserToRole(ListBox1.SelectedValue, li.Value);
                    }
                }
                else
                {
                    if (Roles.IsUserInRole(ListBox1.SelectedValue, li.Value))
                    {
                        Roles.RemoveUserFromRole(ListBox1.SelectedValue, li.Value);
                    }
                }
            }
        }
        protected void Button2_Click(object sender, EventArgs e)
        {
            Membership.DeleteUser(ListBox1.SelectedValue);
            // clear the list box
            ListBox1.Items.Clear();
            // relocad the list box
            MembershipUserCollection users = Membership.GetAllUsers();
            foreach (MembershipUser user in users)
            {
                ListBox1.Items.Add(user.UserName);
            }
        }
        protected void Button3_Click(object sender, EventArgs e)
        {
            MembershipUser userselected = Membership.GetUser(ListBox1.SelectedValue);
            if (userselected.UnlockUser())
            {
                Button3.Enabled = false;
            }
        }
        protected void Button4_Click(object sender, EventArgs e)
        {
            MembershipUser userselected = Membership.GetUser(ListBox1.SelectedValue);
            if (userselected.IsApproved)
            {
                userselected.IsApproved = false;
                Button4.Text = "Approve User";
            }
            else
            {
                userselected.IsApproved = true;
                Button4.Text = "Disapprove User";
            }
            Membership.UpdateUser(userselected);
    
        }
    
    }
    

      

     

    Also add the link in your admin default file:

     

    							# Total Members:
    							<asp:Label Text='<%# Eval("TotalUsers") %>' runat="server" ID="TotalUsersLabel" CssClass="stat">
    							</asp:Label><br />
    							# New Registrations in last 7 days:
    							<asp:Label Text='<%# Eval("NewUsers") %>' runat="server" ID="NewUsersLabel" CssClass="stat">
    							</asp:Label><br />
    							<strong><a href="Users.aspx">Manage Members</a></strong><br />
                                <br />
    							<br />
    
      
    http://www.jimroal.com/
  • Re: How do you manage members once your site is hosted?

    05-19-2007, 7:25 AM
    • Member
      15 point Member
    • TomT
    • Member since 02-27-2007, 5:55 PM
    • Posts 16

    jroal, your code was sent to me by jeremyh, and we put it into the application folder (on 1and1 we have to use a redirector, so I modified the redirector to call the users.aspx, used it 1 time to flag a member as an administrator, then removed the reference from the redirector, and moved the users.aspx and .cs to the admin folder, and modified the admin\default.aspx as you indicated, so that administrators could use it to make other administrators.)

    Note that deleting a user with users.aspx, as-is, creates a problem as it does not delete that member's existing ads/pictures.

    Thank you for this valuable tool.  It works great for us.

  • Re: How do you manage members once your site is hosted?

    05-19-2007, 8:52 AM
    • Star
      7,715 point Star
    • jeremyh
    • Member since 01-23-2003, 12:14 PM
    • York, England
    • Posts 1,380

    Well to be fare it does do what it meant todo it deletes the user.

    You can delete the ads by using the "Site Administration" - "Manage Ads & Features"

    Then "Query by Username" select the tick boxes and choose from the dropdown

    Mark as: Deleted

    or

    Remove from Database

    Hope the steps helps

    Regards
    Jeremy
    If this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.
    That way future readers will know which post solved your issue.
  • Re: How do you manage members once your site is hosted?

    05-22-2007, 9:44 PM
    • Member
      24 point Member
    • jroal
    • Member since 04-12-2007, 10:50 PM
    • Chillicothe, IL
    • Posts 15

     OK, I updated it to show how many active ads the selected member has, and made a link to open the ads in Ads.aspx for managing them.  I also updated the ads control for this.  Notice I added another field in my profile string for my site.  You can delete that stuff for your of course.  The files below will need editing for your site.  Here is the code for the new Users.aspx and the associated C# files:

     

    <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" CodeFile="Users.aspx.cs"
    	Inherits="Users" Title="Manage Users" %>
    
    <asp:Content ID="MainContent" ContentPlaceHolderID="Main" runat="server">
    	<div id="body">
    		<div id="col_main_left">
    			<div id="user_assistance">
    				<a id="content_start"></a>
    				<h3>
    					Actions</h3>
    				<p>Use this section to change user roles, approve or disapprove, unlock, or delete users.  Note: deleting users is not reversible!  
    				They will need to sign up again to become a user again.</p>	
    				<p>
    					<asp:HyperLink ID="BackToAdminLink" runat="server" NavigateUrl="~/Admin/Default.aspx">back to Administration</asp:HyperLink></p>
    			</div>
    		</div>
    		<div id="col_main_right">
    			<h2 class="section">
    				User Administration</h2>
    			<div class="content_right">
                     
                    
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:classifiedsConnection %>"
                        SelectCommand="SELECT COUNT(Id) AS MemberTotal
    
    FROM classifieds_Ads
    
    GROUP BY AdStatus, MemberId
    
    HAVING (AdStatus >= 0) AND (MemberId = @MemberID)">
                        <SelectParameters>
                            <asp:Parameter DefaultValue="0" Name="MemberID" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <fieldset>
                        <asp:Label ID="Label1" runat="server" Font-Bold="True" Text="Select a user from the list"></asp:Label>
                        <p>
                        <asp:ListBox ID="ListBox1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ListBox1_SelectedIndexChanged"
                            Width="80%" Height="150px"></asp:ListBox></p><p>
                        
                        <asp:Label ID="Label4" runat="server" Font-Bold="True" Text="Name:"></asp:Label>
                        </p><p>
                        <asp:Label ID="Label3" runat="server" Font-Bold="True" Text="Email:"></asp:Label>
                        </p><p>
                        <asp:Label ID="Label6" runat="server" Text=" "></asp:Label>
                            <asp:Label ID="PCAnum" runat="server" Font-Bold="True"></asp:Label></p>
                        <asp:HyperLink ID="MemberListings" runat="server"></asp:HyperLink><br />
                        <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1">
                            <ItemTemplate>
                                Total active ads for this member:
                                <asp:Label ID="MemberTotalLabel" runat="server" Text='<%# Eval("MemberTotal") %>'>
                                </asp:Label>
                                
                            </ItemTemplate>
                        </asp:DataList>
                        <asp:Label ID="Label2" runat="server" Font-Bold="True" Text="Roles :"></asp:Label>
                        <asp:CheckBoxList ID="CheckBoxList1" runat="server" AutoPostBack="True"></asp:CheckBoxList>
                        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Update Roles" />
                        <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Delete User" />
                        <asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="Unlock User" />
                        <asp:Button ID="Button4" runat="server" OnClick="Button4_Click" Text="Approve User" />
                    </fieldset>
    			</div>
    		</div>
    	</div>
    </asp:Content>
    
      

     

     The C# file now

     

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    
    public partial class Users : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                MembershipUserCollection users = Membership.GetAllUsers();
                foreach (MembershipUser user in users)
                {
                    ListBox1.Items.Add(user.UserName);
                }
                string[] allRoles = Roles.GetAllRoles();
                foreach (string role in allRoles)
                {
                    CheckBoxList1.Items.Add(role);
                }
                Button1.Enabled = false;
                Button2.Enabled = false;
                Button3.Enabled = false;
                Button4.Enabled = false;
                Label3.Visible = false;
                Label4.Visible = false;
                // Bind users to ListBox.
                ListBox1.DataSource = users;
                ListBox1.DataBind();
            }
        }
        protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            //Clean up the list box first
            string[] allRoles = Roles.GetAllRoles();
            foreach (string role in allRoles)
            {
                ListItem li = CheckBoxList1.Items.FindByValue(role);
                li.Selected = false;
            }
            //now add the right checks
            string[] userRoles = Roles.GetRolesForUser(ListBox1.SelectedValue);
            foreach (string role in userRoles)
            {
                ListItem li = CheckBoxList1.Items.FindByValue(role);
                if (li != null)
                {
                    li.Selected = true;
                }
                Button1.Enabled = true;
                Button2.Enabled = true;
                Label3.Visible = true;
                Label4.Visible = true;
                PCAnum.Visible = true;
                MembershipUser userselected = Membership.GetUser(ListBox1.SelectedValue);
                Label4.Text = "Name: " + Profile.GetProfile(ListBox1.SelectedValue).FirstName + " " + Profile.GetProfile(ListBox1.SelectedValue).LastName;
                Label3.Text = "Email: " + userselected.Email;
                PCAnum.Text = "PCA#:" + Profile.GetProfile(ListBox1.SelectedValue).PCAId;
                MemberListings.Text = "Listings by " + ListBox1.SelectedValue;
                MemberListings.NavigateUrl = "Ads.aspx?member=" + ListBox1.SelectedValue;
    
                if (userselected.IsLockedOut)
                {
                    Button3.Enabled = true;
    
                }
                else
                {
                    Button3.Enabled = false;
    
                }
                if (userselected.IsApproved)
                {
                    Button4.Enabled = true;
                    Button4.Text = "Disapprove User";
                }
                else
                {
                    Button4.Enabled = true;
                    Button4.Text = "Approve User";
                }
                if (userselected.IsOnline)
                {
                //    Label6.Text = "Online Now"; Not working at the moment
                }
                else
                {
                 //   Label6.Text = "Offline";
                }
               // Label6.Text =  Convert.ToString(userselected.LastActivityDate);
                int mid = Profile.GetProfile(ListBox1.SelectedValue).MemberId ;
                SqlDataSource1.SelectCommand = "SELECT COUNT(Id) AS MemberTotal FROM classifieds_Ads GROUP BY AdStatus, MemberId HAVING (AdStatus >= 0) AND (MemberId = " + mid + ")";
    
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            foreach (ListItem li in CheckBoxList1.Items)
            {
                if (li.Selected == true)
                {
                    if (Roles.IsUserInRole(ListBox1.SelectedValue, li.Value) == false)
                    {
                        Roles.AddUserToRole(ListBox1.SelectedValue, li.Value);
                    }
                }
                else
                {
                    if (Roles.IsUserInRole(ListBox1.SelectedValue, li.Value))
                    {
                        Roles.RemoveUserFromRole(ListBox1.SelectedValue, li.Value);
                    }
                }
            }
        }
        protected void Button2_Click(object sender, EventArgs e)
        {
            Membership.DeleteUser(ListBox1.SelectedValue);
            // clear the list box
            ListBox1.Items.Clear();
            // reload the list box
            MembershipUserCollection users = Membership.GetAllUsers();
            foreach (MembershipUser user in users)
            {
                ListBox1.Items.Add(user.UserName);
            }
            //clear the buttons because no user is selected anymore
            Button1.Enabled = false;
            Button2.Enabled = false;
            Button3.Enabled = false;
            Button4.Enabled = false;
            Label3.Visible = false;
            Label4.Visible = false;
            PCAnum.Visible = false;
        }
        protected void Button3_Click(object sender, EventArgs e)
        {
            MembershipUser userselected = Membership.GetUser(ListBox1.SelectedValue);
            if (userselected.UnlockUser())
            {
                Button3.Enabled = false;
            }
        }
        protected void Button4_Click(object sender, EventArgs e)
        {
            MembershipUser userselected = Membership.GetUser(ListBox1.SelectedValue);
            if (userselected.IsApproved)
            {
                userselected.IsApproved = false;
                Button4.Text = "Approve User";
            }
            else
            {
                userselected.IsApproved = true;
                Button4.Text = "Disapprove User";
            }
            Membership.UpdateUser(userselected);
    
        }
    
    }
    
      

     

    http://www.jimroal.com/
  • Re: How do you manage members once your site is hosted?

    05-22-2007, 10:28 PM
    • Member
      24 point Member
    • jroal
    • Member since 04-12-2007, 10:50 PM
    • Chillicothe, IL
    • Posts 15

    Here are the changes to the page load routine in ads.aspx to allow parameters for the query so the link from users will pull up the members ads.

     

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    
    		If Not Page.IsPostBack Then
    			If Not (Page.PreviousPage Is Nothing) Then
    				Dim CommonSearchTextBox As TextBox = CType(Util.FindControlRecursively("CommonSearchTextBox", Page.PreviousPage.Controls), TextBox)
    				Dim CommonWhatsNewRangeList As DropDownList = CType(Util.FindControlRecursively("CommonWhatsNewRangeList", Page.PreviousPage.Controls), DropDownList)
    				If Not (CommonSearchTextBox Is Nothing) AndAlso Not CommonSearchTextBox.Text.Equals(String.Empty) Then
    					QueryTextBox.Text = Server.HtmlEncode(CommonSearchTextBox.Text)
    				Else
    					If Not (CommonWhatsNewRangeList Is Nothing) Then
    						DateRangeDropDown.SelectedIndex = CommonWhatsNewRangeList.SelectedIndex
    					End If
    				End If
    			End If
                Dim memberQs As String = Request.QueryString("member")
                If Not (memberQs Is Nothing) Then
                    Dim userProfile As ProfileCommon = Profile.GetProfile(Server.HtmlEncode(memberQs))
                    If Not (userProfile Is Nothing) AndAlso userProfile.MemberId <> DefaultValues.IdNullValue Then
                        UserNameTextBox.Text = memberQs
                        AdsDataSource.SelectParameters("memberId").DefaultValue = userProfile.MemberId.ToString()
                        WelcomePanel.Visible = False
                        ResultsPanel.Visible = True
                    End If
                End If
            End If
    	End Sub
      
    http://www.jimroal.com/
  • Re: How do you manage members once your site is hosted?

    05-23-2007, 3:44 AM
    • Star
      7,715 point Star
    • jeremyh
    • Member since 01-23-2003, 12:14 PM
    • York, England
    • Posts 1,380

    Hey nice addin update, great work thanks

    Regards
    Jeremy
    If this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.
    That way future readers will know which post solved your issue.
Page 1 of 3 (40 items) 1 2 3 Next >