[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Can't I have my repeater inside a table?

Posted on 2011-03-18
1
Medium Priority
?
1,146 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 2000 total points
ID: 35164080
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month19 days, 14 hours left to enroll

872 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