Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Designing Table Programmatically

Reply
Thread Tools

Designing Table Programmatically

 
 
=?Utf-8?B?RGF2aWQgVGlsbWFu?=
Guest
Posts: n/a
 
      07-25-2005
I need to create some tables on a web page at run time rather than design
time. There could be 1 - 5 tables on the page depending on options. I've
created the tables by creating the cells, rows, and tables just as I want
them, but I don't know how to get them to render. Is there a function to add
the html code for the tables to the aspx file during run time? What is the
best way to handle this. Any examples I find to creating tables
programmatically has the programmer manually add the html code to the aspx
file during design time rather than creating them dynamically for a different
number of controls.
 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      07-25-2005
You just create HtmlTable Controls and add them to the Controls Collection
of the WebForm.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
The sun never sets on
the Kingdom of Heaven

"David Tilman" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
>I need to create some tables on a web page at run time rather than design
> time. There could be 1 - 5 tables on the page depending on options. I've
> created the tables by creating the cells, rows, and tables just as I want
> them, but I don't know how to get them to render. Is there a function to
> add
> the html code for the tables to the aspx file during run time? What is the
> best way to handle this. Any examples I find to creating tables
> programmatically has the programmer manually add the html code to the aspx
> file during design time rather than creating them dynamically for a
> different
> number of controls.



 
Reply With Quote
 
 
 
 
Peter Rilling
Guest
Posts: n/a
 
      07-25-2005
You add them to the Controls property for some parent element. When you say
that you created the cells and rows, do you mean actual TableCell and
TableRow objects?

1) Add some container to your HTML like a DIV. Something that you can
reference in code.
2) Mark this as "runat=server".
3) Add the Table object to the Controls property for the DIV. The table
should then render.


"David Tilman" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> I need to create some tables on a web page at run time rather than design
> time. There could be 1 - 5 tables on the page depending on options. I've
> created the tables by creating the cells, rows, and tables just as I want
> them, but I don't know how to get them to render. Is there a function to

add
> the html code for the tables to the aspx file during run time? What is the
> best way to handle this. Any examples I find to creating tables
> programmatically has the programmer manually add the html code to the aspx
> file during design time rather than creating them dynamically for a

different
> number of controls.



 
Reply With Quote
 
=?Utf-8?B?SEFSSSBQUkFTRCBCQVJV?=
Guest
Posts: n/a
 
      07-25-2005
Use HTMLtextwriter to render and write this in the render event.
Or
Drop placeholder object in the aspx page ...and add controls to it whatever
u have created dynamically
Or
Add controls to Form itself but here u can place it exactly in the way u
need it.

"Kevin Spencer" wrote:

> You just create HtmlTable Controls and add them to the Controls Collection
> of the WebForm.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> The sun never sets on
> the Kingdom of Heaven
>
> "David Tilman" <(E-Mail Removed)> wrote in message
> news(E-Mail Removed)...
> >I need to create some tables on a web page at run time rather than design
> > time. There could be 1 - 5 tables on the page depending on options. I've
> > created the tables by creating the cells, rows, and tables just as I want
> > them, but I don't know how to get them to render. Is there a function to
> > add
> > the html code for the tables to the aspx file during run time? What is the
> > best way to handle this. Any examples I find to creating tables
> > programmatically has the programmer manually add the html code to the aspx
> > file during design time rather than creating them dynamically for a
> > different
> > number of controls.

>
>
>

 
Reply With Quote
 
Charlie@NISH
Guest
Posts: n/a
 
      08-12-2005
You can send HTML markup to browser using
Response.Write("HTMLstringthatbuildstables")

Charlie
"David Tilman" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
>I need to create some tables on a web page at run time rather than design
> time. There could be 1 - 5 tables on the page depending on options. I've
> created the tables by creating the cells, rows, and tables just as I want
> them, but I don't know how to get them to render. Is there a function to
> add
> the html code for the tables to the aspx file during run time? What is the
> best way to handle this. Any examples I find to creating tables
> programmatically has the programmer manually add the html code to the aspx
> file during design time rather than creating them dynamically for a
> different
> number of controls.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
accessing table cell programmatically ma ASP .Net 7 08-27-2007 03:25 PM
VS.NET: Best practices for visually designing DataList controls that will have programmatically loaded datasources ASP .Net 0 06-24-2007 09:35 PM
Table/table rows/table data tag question? Rio HTML 4 11-05-2004 08:11 AM
Change table bgcolor programmatically sam ASP .Net 2 07-08-2004 05:40 PM
Could not load type VTFixup Table from assembly Invalid token in v-table fix-up table. David Williams ASP .Net 2 08-12-2003 07:55 AM



Advertisments