C# <ItemTemplate> and passing variables...

J

Jesper Pedersen

Hi !
How do I access the following spillerID and Session["Session_player"] from
another *aspx page in my application?

<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>

I want to show additional informations about the player when the link is
beeing clicked.

Any suggestions on where to learn/read more about the behaviour of these
variables.

R./jp
 
S

Scott Mitchell [MVP]

Jesper, let me recommend that you read my running series on the DataGrid:

An Extensive Examination of the DataGrid Web Control
http://aspnet.4guysfromrolla.com/articles/040502-1.aspx

The URL above starts at Part 1. By Part 3 you'll be building a demo
that does (I believe) exactly what you want. The one downside is that
the article I have authored focuses in on VB.NET, but VB.NET and C# are
really the same thing, just some differences in the syntax is all.

I also have a 350+ page book that focuses exclusively on the DataGrid,
DataList, and Repeater:

ASP.NET Data Web Controls Kick Start
http://www.4guysfromrolla.com/webtech/chapters/ASPDWC/

hth


Jesper said:
Hi !
How do I access the following spillerID and Session["Session_player"] from
another *aspx page in my application?

<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>

I want to show additional informations about the player when the link is
beeing clicked.

Any suggestions on where to learn/read more about the behaviour of these
variables.

R./jp


--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top