Create Code

S

shapper

Hello,

I need to create a code at runtime:

<table>
<thead>
<tr>
<th>Company</th>
<th>Contact</th>
<th>Title</th>
<th>Address</th>
<th>City</th>
<th>Postal Code</th>
<th>Country</th>
<th>Phone</th>
</tr>
</thead>
<tbody id="itemContainer" runat="server"></tbody>
<tfoot>
<tr>
<th style="text-align:right" colspan="8">
<asp:DataPager runat="server" ID="dpCustomers"
PageSize="10">
<Fields>
<asp:NumericPagerField ButtonCount="5"/>
</Fields>
</asp:DataPager>
</th>
</tr>
</tfoot>
</table>

I am using string builder but my problem is how to add the DataPager
and place it inside the th tag.

How should I do this?

Thanks,
Miguel
 
P

Patrice

Not sure what you want but asp:DataPager is not HTML markup so it won't be
taken into account by the browser. This is used in an ASPX page and it
causes server side the DataPager control to be created as part of the ASPX
page control tree.

So your best bet would be likely to programmaticaly create a DataPage
control and add it inside your table (also i would likely use an htmlTable
object) instead of generating markup that should be then processed as an
ASPX page.

Or is your goal to actually create an ASPX page ?
 
C

Cowboy \(Gregory A. Beamer\)

Are you trying to create an ASPX page? If so, you can save off the page and
then run it by sending the user to that newly created page. You will require
some clean up on the back end.

If you are trying to dynamically embed information, you should consider
inheriting from the control in question, creating a user control for the
HTML bits, or similar. A composite server control is also an option.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
 
S

shapper

Are you trying to create an ASPX page? If so, you can save off the page and
then run it by sending the user to that newly created page. You will require
some clean up on the back end.

If you are trying to dynamically embed information, you should consider
inheriting from the control in question, creating a user control for the
HTML bits, or similar. A composite server control is also an option.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|

Hi,

I am implementing the LayoutTemplate of a ListView (New control
in .NET 3.5).

I want my Layout Template to have a Table and Pager in its footer.

If I use a String Builder I am not able to add the Pager to the Table
Footer.
If I use a Table Control I am not able to set the ID of the TBody tag:
<tbody id="itemContainer" runat="server"></tbody>

Is there a way to define the tbody id?

I am just trying to replicate the following at runtime:
http://weblogs.asp.net/rashid/archive/2007/09/09/asp-net-listview-databinding.aspx

Any idea?

Thanks,
Miguel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top