Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9188531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:01:53+00:00 2026-06-17T20:01:53+00:00

I have a Repeater that will post a User Name, their permission levels, and

  • 0

I have a Repeater that will post a User Name, their permission levels, and a remove button.
The permission level is suppose to sit in a drop down list. The default value is suppose to be what ever the user currently has.

IE

USER A, Guest

USER B, Group Member

USER C, Group Admin

Changing these will eventually fire a sql command to change them in the Database. But that isn’t a problem, I know how to do that.

The values are coming from the repeater source.

ASP CODE:

  <asp:SqlDataSource ID="User_Repeater_Source" runat="server" ConnectionString="<%$ ConnectionStrings:app_migrationConnectionString  %>"
    SelectCommand="SELECT Membership.*, Users.Email, Users.Last_Name + ', ' + Users.First_Name + ' (' + Membership.User_ID + ')' as User_String FROM Membership INNER JOIN Users ON Users.User_ID = Membership.User_ID INNER JOIN Permission_Levels ON Permission_Levels.PID = Membership.PID WHERE GID = @GID">
    <SelectParameters>
      <asp:ControlParameter ControlID="Group" DefaultValue="-1" Name="GID" PropertyName="SelectedValue"
        Type="String" />
    </SelectParameters>
  </asp:SqlDataSource>
  <asp:SqlDataSource ID="User_PL_Source" runat="server" ConnectionString="<%$ ConnectionStrings:app_migrationConnectionString  %>"
    SelectCommand="SELECT * FROM Permission_Levels"></asp:SqlDataSource>

…

  <td>
    <div class="e_Title">
      Edit Group Permission:</div>
    <br />
    <asp:Repeater ID="User_Repeater" runat="server" DataSourceID="User_Repeater_Source">
      <HeaderTemplate>
        <table class="e_Repeater">
          <tr>
            <th>
              User:
            </th>
            <th>
              Permission Level:
            </th>
            <th>
              Remove User:
            </th>
          </tr>
      </HeaderTemplate>
      <ItemTemplate>
        <tr>
          <td>
            <a href='<%#"mailto:" + DataBinder.Eval(Container.DataItem, "Email") %>'>
              <%#DataBinder.Eval(Container.DataItem, "User_String" %></a>
          </td>
          <td>
            <asp:DropDownList ID="User_PL" runat="server" DataSourceID="User_PL_Source" DataTextField="Name"
              DataValueField="PID" AutoPostBack="true">
            </asp:DropDownList>
          </td>
          <td>
            <asp:Button ID="Submit_User_Remove" runat="server" Text="Remove Permission" OnCommand="Remove_User_Permission"
              CommandArgument='<%# Eval("AID")%>' />
          </td>
        </tr>
      </ItemTemplate>
      <FooterTemplate>
        </table>
      </FooterTemplate>
    </asp:Repeater>
  </td>

I am looking to pass the PID into the Dropdownlist and make that the selected choice

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:01:54+00:00Added an answer on June 17, 2026 at 8:01 pm

    First, I believe you did not intend to label this asp-classic, but rather asp.net. No big deal with that.

    I would recommend using OnItemDataBound. Something like this to get you started:

    protected void User_Repeater_OnItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        RepeaterItem item = (RepeaterItem)e.Item;
        if (item.ItemType == ListItemType.AlternatingItem || item.ItemType == ListItemType.Item)
        {
            DropDownList User_PL = (DropDownList)item.FindControl("User_PL");
            ... Set your value here -- consider adding a hidden element with the value you're trying to set it to and get the value the same was as we got the DropDownList
        }
    }
    

    Alternatively, I believe you can bind to the control itself using markup:

    SelectedValue='<%# Eval("PID") %>'
    

    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a repeater that have a button in every row, button will add
I have a repeater that displays a custom user control on a form multiple
i have a repeater that will output a series of items: <asp:repeater ... runat=Server>
I have a repeater that holds a Radio button list, a textbox and a
I have a repeater that's bound to a SQL Data Source (using ASP.NET). Are
I have a repeater control that contains an ItemTemplate containing a databound label and
I have a Repeater control that is being bound to the result of a
I have a Repeater control that loads instances of a custom control I have
Greetings! I have a Repeater control that's using an XmlDataSource control. <asp:FormView id=myFormView runat=server
I have Repeater Control and in that i have code like this <div runat=server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.