Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Working with DataListItemEventArgs


Message #1 by "Oliver, Wells" <WOliver@l...> on Thu, 18 Jul 2002 10:32:16 -0700
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C22E81.0F2C5E20
Content-Type: text/plain;
	charset="iso-8859-1"

Consider the following subroutine:

Public Sub ShowButton (S as System.Object, E as DataListItemEventArgs)
' Handles the created items in the datalist to present the Edit button if
user owns post
	Select Case e.Item.ItemType
		Case ListItemType.Item
			If (Session ("LOGON_NAME") = "Wells Oliver") Then
				e.Item.FindControl ("editButton").Visible 
False
			End If
	End Select
End Sub

That works perfectly. However, I want to compare the session variable
LOGON_NAME to an item in the datalist, the "POSTAUTHOR" field. How can I do
this? I'm entirely unsure how to go about referencing the value of an item
in the datalist.

Thanks for any help.

Wells Oliver
Web Application Programmer
Leviton Voice & Data
xxx-xxx-xxxx
http://www.levitonvoicedata.com 


  Return to Index