Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a value from a datalist to a Function

Status
Not open for further replies.

sthmpsn1

MIS
Sep 26, 2001
456
US
tried using this code below, but the problem is it is sending all the items in the datalist versus the one that is relevant to the item clicked. Can someone help

Public Function SetLink(ByVal thelink As String)As String

Session("link")=theLink

'nextgrid.databind

Return ""

End Function

<asp:datalist ID=&quot;nextgrid&quot; runat=&quot;server&quot; Font-Bold=&quot;true&quot; RepeatColumns=&quot;1&quot; RepeatDirection=&quot;Horizontal&quot;>

<headertemplate><font color=&quot;#990000&quot;>Folders</font></headertemplate>

<itemtemplate>

<table>

<tr>

<td><img src=&quot;../1/images/folder.gif&quot; width=&quot;17&quot; height=&quot;15&quot;><asp:linkbutton ID=&quot;folderlink&quot; runat=&quot;server&quot; OnClick=&quot;getnewfiles&quot; Text=&quot;<%# Container.DataItem.thefolder %>&quot;></asp:linkbutton><%# SetLink(Container.DataItem.thefolderlink) %></td>

</tr>

</table>

</itemtemplate>

</asp:datalist>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top