Solved

Can't I have my repeater inside a table?

Posted on 2011-03-18
1
1,055 Views
Last Modified: 2012-06-21
I have the code below which is basically my table with a repeater that will then display each row.

This was working fine until I had to add runat="server" and an id to my table.

I had to do this as I need to export the table to excel but I am now getting:
BC30311: Value of type 'System.Web.UI.WebControls.Repeater' cannot be converted to 'System.Web.UI.HtmlControls.HtmlTableRow'.

Is there any way around this?

Thanks in advance.
<table class="gridviewheader" runat="server" id="tblCostPrice" cellpadding="0" border="1" cellspacing="0">
        <tr>
            <th>
                Invoice Number
            </th>
            <th>
                Query
            </th>
        </tr>    
        <asp:Repeater ID="rptCostPrice" runat="server" >                                       
            <ItemTemplate>
            <tr>

Open in new window

0
Comment
Question by:scm0sml
1 Comment
 
LVL 4

Accepted Solution

by:
coolcurrent4u earned 500 total points
Comment Utility
if you need to export the table to excel, there are two things you can do,

1. when generating the table, you can also generate a the data to export to excel by having a function that will convert the data if retrieved from database to a cvs format to export to excel
 
2. you can have a JavaScript function that will do the conversion by taking the table in the page and converting accordingly.

An example is found here
http://forums.asp.net/t/1259131.aspx
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now