Note that there are some explanatory texts on larger screens.

plurals
  1. POHow I get Informations of a ListView Item for a Session
    primarykey
    data
    text
    <p>My Situation:</p> <p>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. </p> <p>My Problem:</p> <p>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.</p> <p>My Code:</p> <p>ASPX</p> <pre><code>&lt;asp:ListView runat="server" ID="myListView"&gt; &lt;LayoutTemplate&gt; &lt;table id="UserTable" runat="server" border="0" cellspacing="10" cellpadding="5"&gt; &lt;tr id="Tr1" runat="server"&gt; &lt;th id="Th1" runat="server"&gt;Benutzer&lt;/th&gt; &lt;th id="Th2" runat="server"&gt;eMail&lt;/th&gt; &lt;th id="Th3" runat="server"&gt;Vorname&lt;/th&gt; &lt;th id="Th4" runat="server"&gt;Nachname&lt;/th&gt; &lt;th id="Th5" runat="server"&gt;Telefon&lt;/th&gt; &lt;/tr&gt; &lt;tr runat="server" id="ItemPlaceholder"&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/LayoutTemplate&gt; &lt;ItemTemplate&gt; &lt;tr runat="server"&gt; &lt;td align="left" &gt;&lt;asp:Label ID="Label1" Text='&lt;%# Eval("Benutzer") %&gt;' runat="server" /&gt;&lt;/td&gt; &lt;td align="left"&gt;&lt;asp:Label ID="Label2" Text='&lt;%# Eval("eMail") %&gt;' runat="server" /&gt;&lt;/td&gt; &lt;td align="left"&gt;&lt;asp:Label ID="Label3" Text='&lt;%# Eval("Vorname") %&gt;' runat="server" /&gt;&lt;/td&gt; &lt;td align="left"&gt;&lt;asp:Label ID="Label4" Text='&lt;%# Eval("Nachname") %&gt;' runat="server" /&gt;&lt;/td&gt; &lt;td align="left"&gt;&lt;asp:Label ID="Label5" Text='&lt;%# Eval("Telefon") %&gt;' runat="server" /&gt;&lt;/td&gt; &lt;td align="left"&gt;&lt;asp:Button ID="Button1" Text="Anzeigen" OnCommand="Button1_Command" CommandName="Anzeigen" CommandArgument="myArgument" runat="server" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/ItemTemplate&gt; &lt;/asp:ListView&gt; </code></pre> <p>CS</p> <pre><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 Response.Redirect("Benutzer.aspx"); } } </code></pre> <p>tarasov</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload