I am fairly new to SharePoint.
I try to write the code to find the Label web controls inside the ItemTemplate of DataList in C#. (Get reference to the datalist row's Label control).
I am familiar with VB.NET, but I'm learning C#.
How to convert from VB.NET to C#?
VB.NET version
lblPdtID = CType(datalistPdt.Items(i).FindControl("lblPdtID"), Label)
Convert VB.NET to C#
C# version
lblPdtID = (Label) datalistPdt.Items(i).FindControl("lblPdtID"); // error line