sudharsan s

sudharsan s

  • NA
  • 204
  • 86.9k

display the records in html table instead of grid in C#?

Jul 2 2012 7:01 AM


depending upon the search criteria i want to show the data in html table instead of showing data in grid.

as now i am using grid in my application: my grid code is below.

pls help me to change grid to html table

 
           <div align="center" >
          
                <asp:GridView ID="gvCategory" runat="server" AutoGenerateColumns="False"
                    CellPadding="4" Width="950px" AllowPaging="True"                     
                    ShowFooter="True" EmptyDataText="No Records found !!"
                    BackColor="White" BorderColor="#CC9966" BorderStyle="None"
                    BorderWidth="1px"   >
                 
                    <RowStyle ForeColor="#000066" BackColor="White" Height="30px"
                        HorizontalAlign="Center" />
          
                   
                    <Columns>
                   
                    <asp:TemplateField>
                    <HeaderTemplate>Id</HeaderTemplate>
                    <ItemTemplate>
                      <%# Eval("ref_id") %>                   
                    </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                    <HeaderTemplate>Main Category</HeaderTemplate>
                    <ItemTemplate>

                   <%# Eval("category") %>                   
                    </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                    <HeaderTemplate>Sub Category</HeaderTemplate>
                    <ItemTemplate>

                   <%# Eval("subcategory")%>                   
                    </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                    <HeaderTemplate>Owner Name</HeaderTemplate>
                    <ItemTemplate>

                   <%# Eval("oid")%>                   
                    </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                    <HeaderTemplate>File Name</HeaderTemplate>
                    <ItemTemplate>

                   <a href= "uploads/<%# Eval("up_name")%>" target="_search"><%# Eval("up_name")%></a>                   
                    </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                    <HeaderTemplate>User Keyword</HeaderTemplate>
                    <ItemTemplate>

                   <%# Eval("keyword")%>                   
                    </ItemTemplate>
                    </asp:TemplateField>
                   
                    <asp:TemplateField>
                    <HeaderTemplate>Date of upload</HeaderTemplate>
                    <ItemTemplate>

                   <%# Eval("demo1")%>                   
                    </ItemTemplate>
                    </asp:TemplateField>
                       
                    </Columns>
                  
                  
                    <PagerSettings FirstPageText="First" LastPageText="Last" NextPageText="Next"
                        PageButtonCount="5" PreviousPageText="Previous" Position="Bottom" />
                      
                    <FooterStyle BackColor="#FFFFCC" ForeColor="#000066" />
                  
                    <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center"
                        CssClass="cssPager" />
                   
                    <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
                    <HeaderStyle BackColor="#6699FF" Font-Bold="True" ForeColor="White"
                        Height="40px" />
                  
                    </asp:GridView>
                     <asp:SqlDataSource ID="SqlDataSource2" runat="server"
                    ConnectionString="<%$ ConnectionStrings:file_searchConnectionString %>"
                    SelectCommand="SELECT [ref_id],[category],[subcategory],[oid],[up_name],[keyword,[demo1] from Fileupload " FilterExpression ="{0} LIKE '%{1}%'">
             
                </asp:SqlDataSource>

Answers (2)