473,809 Members | 2,715 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML-ize a server-side control

Hi all,

Perhaps I've drawn a blank here but is there any way for me to use the
server-side objects (perhaps the HTMLTable in conjunction with
HTMLTableCell) to create a table with multiple rows and cells and then dump
the HTMLTable object into my source?

I use these controls when I need to gain access to cells and such upon
postbacks but was wondering about doing this the other way around as opposed
to building a long string using the StringBuilder.A ppend method.

Perhaps build the whole table object and somehow dump it into a literal
control?

Thanks in advance for any help forthcoming...

Regards
John.
Dec 14 '05 #1
5 1099
maybe this


"John" <a@b.c> wrote in message news:O7******** ******@TK2MSFTN GP10.phx.gbl...
Hi all,

Perhaps I've drawn a blank here but is there any way for me to use the server-side objects (perhaps the HTMLTable in conjunction
with HTMLTableCell) to create a table with multiple rows and cells and then dump the HTMLTable object into my source?

I use these controls when I need to gain access to cells and such upon postbacks but was wondering about doing this the other way
around as opposed to building a long string using the StringBuilder.A ppend method.

Perhaps build the whole table object and somehow dump it into a literal control?

Thanks in advance for any help forthcoming...

Regards
John.

Dec 14 '05 #2

maybe this

http://msdn.microsoft.com/library/de...classtopic.asp



"John" <a@b.c> wrote in message news:O7******** ******@TK2MSFTN GP10.phx.gbl...
Hi all,

Perhaps I've drawn a blank here but is there any way for me to use the server-side objects (perhaps the HTMLTable in conjunction
with HTMLTableCell) to create a table with multiple rows and cells and then dump the HTMLTable object into my source?

I use these controls when I need to gain access to cells and such upon postbacks but was wondering about doing this the other way
around as opposed to building a long string using the StringBuilder.A ppend method.

Perhaps build the whole table object and somehow dump it into a literal control?

Thanks in advance for any help forthcoming...

Regards
John.

Dec 14 '05 #3
Hi all,

Never mind - I figured it out- pretty powerful stuff!

Regards
John.

"John" <a@b.c> wrote in message
news:O7******** ******@TK2MSFTN GP10.phx.gbl...
Hi all,

Perhaps I've drawn a blank here but is there any way for me to use the
server-side objects (perhaps the HTMLTable in conjunction with
HTMLTableCell) to create a table with multiple rows and cells and then
dump the HTMLTable object into my source?

I use these controls when I need to gain access to cells and such upon
postbacks but was wondering about doing this the other way around as
opposed to building a long string using the StringBuilder.A ppend method.

Perhaps build the whole table object and somehow dump it into a literal
control?

Thanks in advance for any help forthcoming...

Regards
John.

Dec 14 '05 #4
I'm not shure wether this is what you want to achieve. Anyway,
You can use the RenderControl method of the control (here Table control);
Example:

Let's say your Table-control is called tblData

Table tblData = new Table();
//Now fill your table with your data
//...
//..

System.IO.Strin gWriter sWriter = new System.IO.Strin gWriter();
HtmlTextWriter htmlWriter = new HtmlTextWriter( sWriter);
tblData.RenderC ontrol(htmlWrit er);
string htmlCodeForTabl e = sWriter.ToStrin g();

Marius

"John" <a@b.c> wrote in message
news:O7******** ******@TK2MSFTN GP10.phx.gbl...
Hi all,

Perhaps I've drawn a blank here but is there any way for me to use the
server-side objects (perhaps the HTMLTable in conjunction with
HTMLTableCell) to create a table with multiple rows and cells and then
dump the HTMLTable object into my source?

I use these controls when I need to gain access to cells and such upon
postbacks but was wondering about doing this the other way around as
opposed to building a long string using the StringBuilder.A ppend method.

Perhaps build the whole table object and somehow dump it into a literal
control?

Thanks in advance for any help forthcoming...

Regards
John.

Dec 14 '05 #5
I know you've figured it out, but another option is to add your newly
created HTML Table as a child of an existing control

example: page.controls.a dd

This has additional benefits over the simple render html that I'll
leave you to discover :)

Dec 14 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
7363
by: Al Moritz | last post by:
Hi all, I was always told that the conversion of Word files to HTML as done by Word itself sucks - you get a lot of unnecessary code that can influence the design on web browsers other than Internet Explorer. Our computer expert in my company had told me already a while ago that I should learn HTML and encode myself. I was never inclined to do so (I am no computer expert), and when upon his suggestion I looked how my pages (converted to...
6
3434
by: Ludwig77 | last post by:
When I was first taught html several years ago, I was taught that the following tags are standard for any html formatted message: <HTML> <HEAD> </HEAD> </BODY> </HTML> In fact, I was taught that the opening tags (not the ones with </) are mandatory tags.
1
2429
by: cirillo_curiosone | last post by:
Hi, i'm new to javascript. I started studing it on the web few weeks ago, but still haven't been able to solve one big problem: HOT TO PASS VALUES FROM A SCRIPT VARIABLE TO A CHILD HTML GENERATED BY FUNCTION. Here'e the point: I'm writing a simple website for showing my photographs. It has a central page with many links (as many as galleries are).
33
4789
by: LRW | last post by:
http://gto.ie-studios.net/index.php When you view the above site in IE, if the 1st of the three product images is tall enough to push the cell down a couple of pixels, IE somehow doesn't show that happening. But if you look at it in Firefox you can see the small gap of white where the semi-circle image is broken. I've tried changing the background colors to gray in cells and tables
9
2012
by: Patient Guy | last post by:
Taking the BODY element as an example, all of its style attributes ('alink', 'vlink', 'background', 'text', etc.) are deprecated in HTML 4.01, a fact noted in the DOM Level 2 HTML specification. The DOM specification does not explicitly itself deprecate the use of attributes however for the element in the interface definition section I read. Is there text in the DOM specification that states specifically that the DOM specification...
7
3289
by: Xah Lee | last post by:
Summary: when encountering ex as a unit in css, FireFox (and iCab) did not take into account the font-family. Detail: http://xahlee.org/js/ff_pre_ex.html Xah xah@xahlee.org ∑ http://xahlee.org/
8
3355
by: rn5a | last post by:
I have a HTML page named Index.html which is divided into 3 frames. The URL of 2 of the frames are HTML pages but the 3rd frame houses a ASP page. Now when I go to Windows Explorer, navigate to the folder in which the all the 4 files (3 HTML + 1 ASP) reside & select Index.html (by clicking with the mouse or by using the arrow keys on the keyboard), strangely the Windows "File Download" dialog box (with 'Open', 'Save', 'Cancel', 'More...
6
433
by: Guy Macon | last post by:
cwdjrxyz wrote: HTML 5 has solved the above probem. See the following web page: HTML 5, one vocabulary, two serializations http://www.w3.org/QA/2008/01/html5-is-html-and-xml.html
4
10123
Dököll
by: Dököll | last post by:
Hey Gang! I thought I had a good idea but then I realized JSF doesn't play that... I am trying to mimick what HTML can do in JSF when using target tags to related to inner HTML pages. In orther to get to a links going smoothly in JSF, on would do: <%@ page contentType="text/html" %> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
0
9601
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7660
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3014
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.