I have a datalist in a vb web form.
How can I get the value in specific rows and cells of a datalist?
I could do it for a detailed view, but how to do it for a datalist ??
Below is my code for a detailed view:
Dim selectedCommentAns As String = DetailsView.Rows(0).Cells(1).Text
I tried the same for the datalist, but it has no rows and cells.
This is the asp markup of my directory:
<asp:DataList ID="DataListPhotoGallery" runat="server" CellPadding="5" CellSpacing="12" DataKeyField="PhotographerPhotoId" DataSourceID="SqlDataSourcePhotoGallery" RepeatColumns="3"> <ItemTemplate> <asp:Image ID="Image1" runat="server" BorderColor="#C7B273" BorderStyle="Groove" BorderWidth="12px" Height="200px" ImageUrl='<%# Eval("PhotographerPhotoImgPath", "images/UserUploadedPhoto/{0}") %>' Width="220px" /> <br /> Photo No: <asp:Label ID="PhotographerPhotoIdLabel" runat="server" Text='<%# Eval("PhotographerPhotoId") %>' /> <br /> Photo Description: <asp:Label ID="PhotographerPhotoDescLabel" runat="server" Text='<%# Eval("PhotographerPhotoDesc") %>' /> <br /> Photo Name: <asp:Label ID="PhotographerPhotoImgNameLabel" runat="server" Text='<%# Eval("PhotographerPhotoImgName") %>' /> <br /> Photographer Name: <asp:Label ID="PhotographerIdLabel" runat="server" Text='<%# Eval("PhotographerName") %>' /> <br /> <asp:Button ID="AddCommentBtn" runat="server" CommandArgument='<%# Eval("PhotographerPhotoId") %>' Font-Bold="True" Font-Size="Medium" onclick="AddCommentBtn_Click" Text="Add Comment" /> <asp:Button ID="Button2" runat="server" CommandArgument='<%# Eval("PhotographerPhotoId") %>' Font-Bold="True" Font-Size="Medium" onclick="Button2_Click" Text="Order Photo" /> <br />
source share