Click here to Skip to main content
15,885,914 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

Dear all,

I need to convert a table object to a html string .Currently I am using Asp.net with vb.

I need to pass a table object to a div.

Here is my code :

Dim value As Table

        Dim array() As Object = extractedNodesExclusive.ToArray()

        For Each element In array
 
            value = element

        Next

        div_Recommendation.Controls.Add(value)


Error :Value of type 'Aspose.Words.Tables.Table' cannot be converted to 'System.Web.UI.Control'.
Can anyone help me?
and
Unable to cast object of type 'Aspose.Words.Tables.Table' to type 'System.Web.UI.Control'.


Thanks
alis
Posted
Updated 22-Jan-14 20:19pm
v3

1 solution

ASP.NET has a TON of controls that turn tables in to HTML. grid view, repeater, datagrid, you name it.

The error means what it says. The code you wrote is nonsense. You don't convert a table to a control. You pass the data in the table to the data context of the control.
 
Share this answer
 
Comments
SoMad 23-Jan-14 2:41am    
From OP:

Hi christian,

SO how i fix this?

I just needed to send the table with formatting text to this div.

Thanks.alis
Christian Graus 23-Jan-14 2:42am    
WRite proper ASP.NET code. If you're using a third party library, read their documentation. You need to set the DataSource of a data bound control, and call DataBind, and it will display as a table.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900