473,241 Members | 1,644 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

HTML Code generation

Hello,
I was wondering if there is a way to store all the HTML element information
in a database and then dynamically generate the HTML code for a page?..
Basically, I do not want to design every HTML page, instead just define the
elements like "label", "Textbox", "Submit" button etc., in a database and
then have a tool generate the HTML code forme..
Does anyone have any ideas or pointers??

Thanks.
Jun 7 '06 #1
4 1508
That would be tough because the elements are objects, and do not all have
the same properties (a TextBox does not have the same properties as a Label,
for example). If you REALLY wanted to do that (I don't know why you would,
if you know exactly what the HTML will be use a *.html file), create a
database table with 3 fields:

First Field (the primary key): an integer specifying the order of the tags
Second Field: a string that lists the tag (such as input, font, table, etc.)
and attributes or literal content
Third Field: a string that specifies whether the second field is an opening
tag, closing tag, or literal content

The second field would need to be parsed, since it must be all one string
and you cannot have separate fields for the properties since different tags
have different properties. When the third field has a value of 'closingtag'
you can either give the second field an empty string and dynamically
determine what tag it is closing or just give the second field a value of
what the closing tag would look like (</table>, </font>, etc.). However, I
still think that doing this is more work than necessary and that you should
find a better way, if you let us know your reason for wanting to put this
info in a database instead of one of the conventional methods we might be
able to help you find a better and easier way to achieve your goal.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Ganesh Muthuvelu" <Ga*************@discussions.microsoft.com> wrote in
message news:52**********************************@microsof t.com...
Hello,
I was wondering if there is a way to store all the HTML element
information
in a database and then dynamically generate the HTML code for a page?..
Basically, I do not want to design every HTML page, instead just define
the
elements like "label", "Textbox", "Submit" button etc., in a database and
then have a tool generate the HTML code forme..
Does anyone have any ideas or pointers??

Thanks.

Jun 7 '06 #2
Ganesh,
Certainly you *could* do that; essentially you are describing a means of
assembling a big string full of HTML. But, what would be the point of this?
It would be missing the server-side ASP.NET Page model, events, and
everything else needed for a fully functioning ASP.NET application.
Sounds like a step backwards to me.
Now, if you want to add ASP.NET controls to a page programmatically, that
can certainly be done, and you can "have your cake, and eat it, too".
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Ganesh Muthuvelu" wrote:
Hello,
I was wondering if there is a way to store all the HTML element information
in a database and then dynamically generate the HTML code for a page?..
Basically, I do not want to design every HTML page, instead just define the
elements like "label", "Textbox", "Submit" button etc., in a database and
then have a tool generate the HTML code forme..
Does anyone have any ideas or pointers??

Thanks.

Jun 7 '06 #3
Peter,
Yes.. I see what you are saying. Now, is there a way to add ASP .NET
controls dynamically to a page including the layout of the controls as well
as the look & feel?..
Basically, I have a application which pulls data from a 3rd party system and
pushes data back to the same system after the user makes the changes.. All
data are exchanged as "XML".. So, I need to show the data in a neat way to
the user so that the user can change it and send it back..

Since the volume and type of data is so much, I cannot generate a ASPX page
for each XML exchange and hence looking for doing stuff dynamically if the
necessary info is stored in the database about the XML elements..

Any ideas/pointers will be appreciated..

Thanks.

"Peter Bromberg [C# MVP]" wrote:
Ganesh,
Certainly you *could* do that; essentially you are describing a means of
assembling a big string full of HTML. But, what would be the point of this?
It would be missing the server-side ASP.NET Page model, events, and
everything else needed for a fully functioning ASP.NET application.
Sounds like a step backwards to me.
Now, if you want to add ASP.NET controls to a page programmatically, that
can certainly be done, and you can "have your cake, and eat it, too".
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Ganesh Muthuvelu" wrote:
Hello,
I was wondering if there is a way to store all the HTML element information
in a database and then dynamically generate the HTML code for a page?..
Basically, I do not want to design every HTML page, instead just define the
elements like "label", "Textbox", "Submit" button etc., in a database and
then have a tool generate the HTML code forme..
Does anyone have any ideas or pointers??

Thanks.

Jun 7 '06 #4
google "htmltextwriter"

"Ganesh Muthuvelu" <Ga*************@discussions.microsoft.com> wrote in message
news:52**********************************@microsof t.com...
Hello,
I was wondering if there is a way to store all the HTML element information
in a database and then dynamically generate the HTML code for a page?..
Basically, I do not want to design every HTML page, instead just define the
elements like "label", "Textbox", "Submit" button etc., in a database and
then have a tool generate the HTML code forme..
Does anyone have any ideas or pointers??

Thanks.

Jun 8 '06 #5

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

Similar topics

51
by: Mudge | last post by:
Please, someone, tell me why OO in PHP is better than procedural.
1
by: max | last post by:
Hi all, I am looking for a recent rundown of HTML generation frameworks rated by 1) being up-to date 2) power 3) complexity and more informally - what do python folks like to use for HTML...
13
by: Michele Simionato | last post by:
What is the recommended way of generating HTML from Python? I know of HTMLGen and of few recipes in the Cookbook, but is there something which is more or less standard? Also, are there plans to...
3
by: Christophe Guillon | last post by:
Hello I would like to have a hypertext link which, when I click on it, leads to a web page where a certain word is highlighted. Depending on the link, the same target page would be displayed but...
2
by: Nick | last post by:
Hi all, I'm about to embark on a new project and can't decide quite how to do it. In summary, I have a database whose data I want to use to create html pages for a website. The website will just...
1
by: Gina | last post by:
I need to add the cell generation to a templated program. I am using graphics magician, but my problem is with the math. I cannot figure out my cell generations. I do know that I need two...
1
by: Lonnie Princehouse | last post by:
I plan on writing some documentation that will consist of blocks of commentary with interspersed snippets of syntax-colored Python code and the occaisional image. Does anyone know of a package...
1
by: Ryan Ginstrom | last post by:
I have been maintaining a body of documentation in plain HTML files. I would now like to automate the generation of the HTML files. Maintaining the HTML files now is tedious and error prone,...
5
by: smittie31 | last post by:
I am having a problem with a border around me html page. The border does not flow thru the whole html page, it cuts off halfway. --> See http://keithborom.com/marlon-sanders CSS STYLESHEET ...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.