473,385 Members | 1,409 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,385 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 1514
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.