Fixed...finally clicked that one of the beauties of LINQ is the reduced amount of code monkeying we have to do. So to summarize I really didn't need to have an ItemDataBound event at all to grab the values coming back from the database calls. Instead I just call my formatting functions from my ascx and it works beautifu
<asp:LinqDataSource ID="lnkViewSpkrDir" runat="server" ContextTypeName="GovernanceInstitute.Modules.SpeakerDirectory.DirectoryDataContext"
OrderBy="LastName" TableName="TGIDirectories">
</asp:LinqDataSource>
<asp:ListView ID="lstDirectory" runat="server" DataKeyNames="ItemID" DataSourceID="lnkViewSpkrDir">
<LayoutTemplate>
<table runat="server">
<tr runat="server">
<td runat="server">
<table id="itemPlaceholderContainer" runat="server" border="0" style="">
<tr id="itemPlaceholder" runat="server">
</tr>
</table>
</td>
</tr>
<tr runat="server">
<td runat="server" style="">
<asp:DataPager ID="lstDirectoryPager" runat="server" PageSize="5">
<Fields>
<asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False"
ShowPreviousPageButton="False" />
<asp:NumericPagerField />
<asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False"
ShowPreviousPageButton="False" />
</Fields>
</asp:DataPager>
</td>
</tr>
</table>
</LayoutTemplate>
<EmptyDataTemplate>
<table runat="server" style="">
<tr>
<td>
No data was returned.
</td>
</tr>
</table>
</EmptyDataTemplate>
<ItemTemplate>
<tr>
<td width="120px">
<!-- put in logic to check if imagepath is null, and if so hide control -->
<asp:Image ID="imgSpeaker" runat="server" ImageUrl='<%# Bind(Container.DataItem, "imagePath") %>'
Height="150px" Width="100px" />
</td>
<td align="left" width="120px">
<asp:LinkButton ID="lnkFullName" runat="server" Text='<%# FormatNameString(Eval("firstName"),Eval("middleInitial"),Eval("lastName"),Eval("suffix")) %>'
CommandName="lnkFullName_Link" CommandArgument='<%# Eval("itemID")%>' OnClick="lnkFullName_Click"></asp:LinkButton><br />
<asp:Label ID="lblCityState" runat="server" Text='<%# FormatCityState(Eval("city"),Eval("State")) %>'
SkinID="lblCityState" />
</td>
<td align="left">
<asp:Label ID="lblBio" runat="server" Text='<%# Shorten(Eval("Biography"), 200) %>' />
</td>
</tr>
</ItemTemplate>
</asp:ListView>
Imports System
Imports System.Collections
Imports System.Configuration
Imports System.Data
Imports System.Linq
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Xml.Linq
Imports DotNetNuke
Imports DotNetNuke.Security
Imports DotNetNuke.Entities.Modules
Namespace Modules.SpeakerDirectory
Partial Public Class ViewDirectory
Inherits DotNetNuke.Entities.Modules.PortalModuleBase
#Region "Event Handlers"
Protected Sub lnkFullName_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim objlnkFullName As LinkButton = sender
Response.Redirect(NavigateURL(PortalSettings.ActiveTab.TabID, "viewspeaker", "mid=" & CStr(ModuleId), "itemid=" & objlnkFullName.CommandArgument))
End Sub
Protected Sub lnkViewSpkrDir_Selecting(ByVal sender As Object, ByVal e As LinqDataSourceSelectEventArgs)
e.WhereParameters("ModuleId") = ModuleId
End Sub
Public Function FormatCityState(ByVal city As String, ByVal state As String) As String
Dim locString As String
If String.IsNullOrEmpty(city) Then
If String.IsNullOrEmpty(state) Then
locString = "City and State not in our database"
End If
ElseIf locString = city.Trim Then
Else
locString = city.Trim & ", " & state.Trim
End If
Return locString
End Function
Public Function FormatNameString(ByVal first As String, ByVal last As String, ByVal minitial As String, ByVal suffix As String) As String
Dim namestring As String
If String.IsNullOrEmpty(suffix) Then
If String.IsNullOrEmpty(minitial) Then
namestring = first & " " & last
End If
namestring = first & " " & minitial & ". " & last
Else
namestring = first & " " & minitial & ". " & last & ", " & suffix
End If
Return namestring
End Function
Public Function GetURL(ByVal fldval As String) As String
If InStr(fldval, "http://") Then
Return fldval
ElseIf fldval = "" Then
Return ""
ElseIf String.IsNullOrEmpty(fldval) Then
Return ""
Else
Return "http://" & fldval
End If
End Function
Function Shorten(ByVal sString As String, ByVal sLength As Integer) As String
If Len(sString) > sLength Then
Shorten = Left(sString, sLength) & "...."
Else
Shorten = sString
End If
End Function
#End Region
End Class
End Namespace