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

  • SEARCH
  • Home
  • 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 8259267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:49:09+00:00 2026-06-08T02:49:09+00:00

My Situation: I’ ve a ListView, that get Data from the Active Directory. The

  • 0

My Situation:

I’ ve a ListView, that get Data from the Active Directory. The User input a String (Lastname or a part of this) in a TextBox. Than the ListView list all AD Users with the same string from the TextBox. Every Line get a Button “Anzeigen” to get more Informations about the User. A second WebForm “Benutzer.aspx” display the Information about this User. I think I need a Value (ID or eMail) of the selected User for the second WebForm. So I need a Session. So if I click the Button “Anzeigen” I need the Value of the eMail or ect. of this actually Line in the ListView.

My Problem:

I don’t know how I can get the other Informations of this ListView Line. I think I need a kind of Index or I must control a Cell.

My Code:

ASPX

<asp:ListView runat="server" ID="myListView">

        <LayoutTemplate>
            <table id="UserTable" runat="server" border="0" cellspacing="10" cellpadding="5">
                <tr id="Tr1" runat="server">
                    <th id="Th1" runat="server">Benutzer</th>
                    <th id="Th2" runat="server">eMail</th>
                    <th id="Th3" runat="server">Vorname</th>
                    <th id="Th4" runat="server">Nachname</th>
                    <th id="Th5" runat="server">Telefon</th>
                </tr>
                <tr runat="server" id="ItemPlaceholder">
                </tr>
            </table>
        </LayoutTemplate>

        <ItemTemplate>

            <tr runat="server"> 

                <td align="left" ><asp:Label ID="Label1" Text='<%# Eval("Benutzer") %>' runat="server" /></td>
                <td align="left"><asp:Label ID="Label2" Text='<%# Eval("eMail") %>' runat="server" /></td>
                <td align="left"><asp:Label ID="Label3" Text='<%# Eval("Vorname") %>' runat="server" /></td>
                <td align="left"><asp:Label ID="Label4" Text='<%# Eval("Nachname") %>' runat="server" /></td>
                <td align="left"><asp:Label ID="Label5" Text='<%# Eval("Telefon") %>' runat="server" /></td>
                <td align="left"><asp:Button ID="Button1" Text="Anzeigen" OnCommand="Button1_Command" CommandName="Anzeigen" CommandArgument="myArgument" runat="server" /></td>

            </tr>

        </ItemTemplate>

        </asp:ListView>

CS

protected void Button1_Command(object sender, CommandEventArgs e)
        {
            if (e.CommandName == "Anzeigen")
            {
              //Here I need a Session and the Informations about the Selected User in the Line

                Response.Redirect("Benutzer.aspx");

            }
    }

tarasov

  • 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-08T02:49:11+00:00Added an answer on June 8, 2026 at 2:49 am

    If I unerstand correctly, you need a reference to Label which shows the email in the list view. For this first get a reference, see the below code:

    protected void Button1_Command(object sender, CommandEventArgs e)
        {
            if (e.CommandName == "Anzeigen")
            {
              //Here I need a Session and the Informations about the Selected User in the Line
                Label lb = (Label) myListView.Items(1).FindControl("Label2"); // give the right index, Label2 contains the email so give its ID but index should be correct
                string email = lb.Text;
                Response.Redirect("Benutzer.aspx");
    
            }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Situation: text: a string R: a regex that matches part of the string. This
Situation is a string that results in something like this: <p>This is some text
Situation is you have to develop an application against an Active Directory Tree. Want
Situation: I have many gzipped input files that I want to process in a
Situation: A user submits a url and my php script adds that url to
Situation: I often run into this problematic and never know how to solve it.
Situation: I want to provide a website service where users can enter some data
Situation with Thai text on a client site is that we can't control where
Situation: I am writing a program in C that maintains a number of threads.
Situation: I send an ajax request that returns HTML containing elements needing event handlers

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.