Link to home
Start Free TrialLog in
Avatar of SM17CH
SM17CH

asked on

Convert HTML table to aspx control

Hey,
Being new at asp.net I used Adobe Dreamweaver to build a table. I then copied the code across into Visual Studio 2008.

How can I easily make this able an asp control so I can do stuff to it such as dynamically add additional rows etc.?

Cheers
Mitch
<table width="768" border="0">
  <tr>
    <td width="81">Date</td>
    <td width="159" colspan="2">&nbsp;</td>
    <td width="95">&nbsp;</td>
    <td width="159" colspan="2">&nbsp;</td>
    <td width="89">&nbsp;</td>
    <td width="159">&nbsp;</td>
  </tr>
  <tr>
    <td>Start Time</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>End Time</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>Category</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Start Time</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>End Time</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>Category</td>
    <td>&nbsp;</td>
  </tr>
</table>

Open in new window

step 1. Convert Html page into .aspx. for example you have index.html, open that with dreamweaver and save as index.aspx.

step 2. open ASP.NET web site. put that file into that folder.

step 3. After putting this, right click folder, you will sub menu that menu choose Add New Item. After that the new dialog box will be opend. then choose class file. if you use C#, change that name as index.aspx.cs and finally press OK.

step 4. In that class file, change the following

public partial class _index : System.Web.UI.age
{

}

step 5. Now go to index.aspx, bottom of that page, there will be source, if your press that you will get html content

step 6. Write the following coding at top of that source

<%@ Page Language="C#" AutoEventWrireUp="true" CodeFile = "~/index.aspx.cs" Inherits="_index" %>

step 7. Finally save that file and close entire web application.

Step 8. Now you can open that web application

Step 9. After openning, press F5, the page will be executed.

Source: http://www.dotnetspider.com/forum/103000-Convert-HTML-into-aspx.aspx
>> Lol, Same link posted.. that dotnetspider.....
Avatar of SM17CH
SM17CH

ASKER

Im not sure if thats what Im after or not as I may have not explained properly.
I already have a asp.net project setup.
I have the HTML table built (code shown in orignal post).
I want to convert the table to an asp control so I can use the c# code to perform actions on it.
Dont ASP tables look something like...
<asp:Table ID="Table1" runat="server">
 
means you need a user control ????
ASKER CERTIFIED SOLUTION
Avatar of ashraf882
ashraf882
Flag of Bangladesh image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial