title: Passing a data list value in asp.net ( closed )
body: <p>I have a datalist that bound to a database where now the label is change to a link button </p>
  
  <pre><code>&lt;asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" &gt;
  &lt;ItemTemplate&gt;
  &lt;asp:LinkButton ID="LinkButton1" runat="server" Text='&lt;%# Eval("username") %&gt;'&gt;
  &lt;/asp:LinkButton&gt;
  .....some other datalist item 
  &lt;/ItemTemplate&gt;
  &lt;/asp:DataList&gt;
  </code></pre>
  
  <p>For this case I wanted the link button to fired up a new page where the Eval("username") value is passed to the new page.</p>
  
  <p>I'm thinking about passing it using session such as .... </p>
  
  <pre><code>string any_variable ;
  session["Picked_username_from_datalist"] = any_variable ;
  response.redirect("newpage.aspx");
  </code></pre>
  
  <p>so that the variable that I'm going to pass using session can be manipulated.</p>
  
  <p>But my problem is I have no idea how to assign the Text='&lt;%# Eval("username") %> to the variable any_variable ..... </p>
  
  <p>~~ the assigned value for the variable is depends on the text of the databind that binded to the database .... for example ... 1st linkbutton text is username1 , and the 2nd is username2 and so on based on my SQL select command ..... </p>
  
  <p>I need the selected Text='&lt;%# Eval("username") %> so that I can manipulate the information to display another databind control based on the value.</p>
  
  <p>Can anybody help me?</p>