Hi Scott !
Great...thanks.....now is works......nearly as planned.......
Now, I got to figure out why Session["Session_player"] contains the last
value in the database rather than the current value.
It is assigned in:
<ItemTemplate>
<a href="player_details.aspx?spillerID=<%#
DataBinder.Eval(Container.DataItem, "PlayerID") %>"
target="_parent"> <%# DataBinder.Eval(Container.DataItem,
"playerFirstName") %>
<%#
DataBinder.Eval(Container.DataItem, "playerLastName") %> </a>
<%# Session["Session_player"] =
DataBinder.Eval(Container.DataItem, "playerID") %>
</ItemTemplate>
The <%# Session["Session_player"] = DataBinder.Eval(Container.DataItem,
"playerID") %> display correctly in the Datagrid.
I´am trying to get the player_details.aspx file to receive the current
player.
The spillerID will not be acceptet and now the Session["Session_player"] is
changed to contain the last value in the database insted.
Cmd = new OleDbCommand("SELECT * FROM tblPlayers WHERE PlayerID = " +
Session["Session_player"] + " ", Conn);
R./jp
Scott Allen said:
Hi Jesper:
Keep the entire statement inside the data binding delimeters:
<%# Session["Session_player"] =
DataBinder.Eval(Container.DataItem, "playerID") %>
HTH,
--
Scott
http://www.OdeToCode.com/blogs/scott/
This works fine:
<% Session["Session_player"]=1; %>
but this:
<% Session["Session_player"]=%> <%# DataBinder.Eval(Container.DataItem,
"playerID") %> <%; %>
do not work.
The playerID contains the value 1, so the values in both examples are the
same.
What do you suggest - where should i look ??