piya p

piya p

  • NA
  • 84
  • 47.9k

How to remove alternate text of second image in datalist

Apr 16 2014 1:01 AM
In my application I am using datalist with 2 image button.
My code is like:
      <asp:DataList ID="datalist1" RepeatDirection="Horizontal" RepeatColumns="3"  CellSpacing="10"  runat="server"  Height="102px" Width="229px"   > 
    <ItemTemplate> 

        <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl='<%# Eval("img1") %>' Height="150" Width="150"  AlternateText=" "   OnClick="Button1_Click" /> 
      
        <asp:label  ID="label1" runat="server" Text='<%# Eval("Col2") %>'/> 
            
                        <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images (2).jpg" Height="150" Width="150"  AlternateText=" "   OnClick="Button1_Click" /> 

          
</asp:DataList>

Here alternate text=" " is working properly for 1st image.
But 2nd image coming twice.
     

Answers (7)