Populating DataList

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hamayun Khan
    New Member
    • Aug 2007
    • 106

    Populating DataList

    Hi I want to populate the Datalist control from some data using code below
    Code:
    <asp:DataList Width="100%" ID="DataList2" runat="server" DataSourceID="SqlDataSource2" RepeatDirection=horizontal RepeatLayout="table" RepeatColumns="3" >
      <ItemTemplate>                                            
       <asp:LinkButton runat="server" OnCommand="lnkButtonCommand" CommandArgument='<%# Eval("Region") %>' CommandName="Region">
    <%# Eval("Region") %> ' Pass This value to some function If The function retrun false don't create linkbutton just movenext.
    </asp:LinkButton>                                            
         </ItemTemplate>                                            
      </asp:DataList>               
     <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:dbase_DataConnectionString6 %>" SelectCommand="SELECT  [Region],[RegionID] FROM [tblregion]"></asp:SqlDataSource>
    I want to pass Eval("Region") to some function. if the function return false Then i want not to create this button and check for the next value.
    Thanks
Working...