473,761 Members | 7,710 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dynamic content from SQL

Given HTML text (likely from SQL), is there any method that could be
employed to render server and/or custom controls that are contained inside
of that text? I would be loading content from a database and would like to
'expand' the server controls. Possibly even recursively.

Hope this makes sense, but I am guessing the answer is no.

If this is something that can't be done, I am looking at creating my own
markup tags and searching for them with Regular Expressions. Then rendering
them using my own custom classes. Does this seem like something that is 'way
out there' or rather mainstream?

-Andrew
Nov 19 '05 #1
7 1504
Sounds a lot like serialization, so you might want to look that up.
If that doesn't work, you could parse the text and create controls
dynamically as needed.

Dim tb as new TextBox()
SomePanel.Contr ols.Add(tb)

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Andrew Robinson" <ne****@nospam. nospam> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Given HTML text (likely from SQL), is there any method that could be
employed to render server and/or custom controls that are contained inside
of that text? I would be loading content from a database and would like to
'expand' the server controls. Possibly even recursively.

Hope this makes sense, but I am guessing the answer is no.

If this is something that can't be done, I am looking at creating my own
markup tags and searching for them with Regular Expressions. Then
rendering
them using my own custom classes. Does this seem like something that is
'way
out there' or rather mainstream?

-Andrew

Nov 19 '05 #2
On Wed, 02 Mar 2005 15:57:00 -0600, Andrew Robinson <ne****@nospam. nospam>
wrote:
Given HTML text (likely from SQL), is there any method that could be
employed to render server and/or custom controls that are contained
inside
of that text? I would be loading content from a database and would like
to
'expand' the server controls. Possibly even recursively.

Hope this makes sense, but I am guessing the answer is no.

If this is something that can't be done, I am looking at creating my own
markup tags and searching for them with Regular Expressions. Then
rendering
them using my own custom classes. Does this seem like something that is
'way
out there' or rather mainstream?

-Andrew


Have you looked at Page.ParseContr ol?

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

I assume you'll need to use this in the Init stage....Google on this
method name and I'm sure you'll find examples on how to use it. In fact,
I think there's one somewhere, an old WROX article about using XML w/ XSLT
and this method to allow the definition of pages without using any code,
just XML. Might be some good insight in that article you can use as well;
here, I just found it:

http://www.devarticles.com/c/a/ASP.N...rols-Using-XML

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 19 '05 #3
> Given HTML text (likely from SQL), is there any method that could be
employed to render server and/or custom controls that are contained inside
of that text? I would be loading content from a database and would like to
'expand' the server controls. Possibly even recursively.
The answer is yes, but some things that CAN be done SHOULD not. You could
dig yourself a swimming pool with a spoon, but it wouldn't be a good idea to
do so.

It seems to me that part of your problem is the way you view ASP.Net. It
sounds like you're coming from an ASP/Scripted/Procedural programming
background. Objects are not text, and you shouldn't treat them like text.
If this is something that can't be done, I am looking at creating my own
markup tags and searching for them with Regular Expressions. Then
rendering
them using my own custom classes. Does this seem like something that is
'way
out there' or rather mainstream?
Heck, it can't be mainstream, because I don't even know what you're talking
about. But it seems like you're trying to dig a swimming pool with a spoon
again. What sort of requirement is this gerrymandered technique soupposed to
fulfill?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Andrew Robinson" <ne****@nospam. nospam> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. .. Given HTML text (likely from SQL), is there any method that could be
employed to render server and/or custom controls that are contained inside
of that text? I would be loading content from a database and would like to
'expand' the server controls. Possibly even recursively.

Hope this makes sense, but I am guessing the answer is no.

If this is something that can't be done, I am looking at creating my own
markup tags and searching for them with Regular Expressions. Then
rendering
them using my own custom classes. Does this seem like something that is
'way
out there' or rather mainstream?

-Andrew

Nov 19 '05 #4
Ok, here is more or less what I am exploring....

We have a couple of web servers at a few hosting facilities. A few hundred
to a few thousand unique visitors per day. Nothing extraordinary here. And
in all fairness, our server hardware is likely overkill. Our web content is
almost entirely static in nature. The current site is made up of about 150
pages.

The big issue is that while the content is static, it is being updated every
few days. We have html and image updates that need to go live at critical
time intervals. The updates are all driven by advertising and marketing.
There is a lengthy approval process where the site gets posted to a staging
server, approved by the powers that be and then it needs to go live at the
exact moment that advertising deems. Typically in the middle of the night
when the date rolls (and I am asleep).

I would like to explore putting content inside of SQL. The content can be
routed and approved as needed. Then replicated using either some type of SQL
replication or some type of home grown Web Service push/pull method.

Give the appropriate data structure, the site can now make content live when
the calendar rolls. I can put it up days in advance and not worry about it.

As I said before, the content is almost entirely static. Some text and a lot
of images and graphics. I was thinking of developing a set of custom
controls that would render text (html) or images and pull from SQL.

If I develop some type of Image and Text custom control that would be pretty
simple and maybe I will leave it at that. But, I think about maybe having
pages that are recursively generated where a html controls pulls from SQL.
The pulled page may contain other controls that need to be rendered /
expanded.

-Andrew
"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:O1******** ******@TK2MSFTN GP15.phx.gbl...
Given HTML text (likely from SQL), is there any method that could be
employed to render server and/or custom controls that are contained inside of that text? I would be loading content from a database and would like to 'expand' the server controls. Possibly even recursively.
The answer is yes, but some things that CAN be done SHOULD not. You could
dig yourself a swimming pool with a spoon, but it wouldn't be a good idea

to do so.

It seems to me that part of your problem is the way you view ASP.Net. It
sounds like you're coming from an ASP/Scripted/Procedural programming
background. Objects are not text, and you shouldn't treat them like text.
If this is something that can't be done, I am looking at creating my own
markup tags and searching for them with Regular Expressions. Then
rendering
them using my own custom classes. Does this seem like something that is
'way
out there' or rather mainstream?
Heck, it can't be mainstream, because I don't even know what you're

talking about. But it seems like you're trying to dig a swimming pool with a spoon
again. What sort of requirement is this gerrymandered technique soupposed to fulfill?

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.

"Andrew Robinson" <ne****@nospam. nospam> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Given HTML text (likely from SQL), is there any method that could be
employed to render server and/or custom controls that are contained inside of that text? I would be loading content from a database and would like to 'expand' the server controls. Possibly even recursively.

Hope this makes sense, but I am guessing the answer is no.

If this is something that can't be done, I am looking at creating my own
markup tags and searching for them with Regular Expressions. Then
rendering
them using my own custom classes. Does this seem like something that is
'way
out there' or rather mainstream?

-Andrew


Nov 19 '05 #5
I think this is very much what I was looking for.

If I use my own customer controls, will I have any issue resolving them to
the correct namespace?

Thanks much,

-Andrew

"Craig Deelsnyder" <cdeelsny@no_sp am_4_meyahoo.co m> wrote in message
news:op******** *******@bench2w 2p.na.corp.born .com...
On Wed, 02 Mar 2005 15:57:00 -0600, Andrew Robinson <ne****@nospam. nospam>
wrote:
Given HTML text (likely from SQL), is there any method that could be
employed to render server and/or custom controls that are contained
inside
of that text? I would be loading content from a database and would like
to
'expand' the server controls. Possibly even recursively.

Hope this makes sense, but I am guessing the answer is no.

If this is something that can't be done, I am looking at creating my own
markup tags and searching for them with Regular Expressions. Then
rendering
them using my own custom classes. Does this seem like something that is
'way
out there' or rather mainstream?

-Andrew
Have you looked at Page.ParseContr ol?

http://msdn.microsoft.com/library/de...ntroltopic.asp
I assume you'll need to use this in the Init stage....Google on this
method name and I'm sure you'll find examples on how to use it. In fact,
I think there's one somewhere, an old WROX article about using XML w/ XSLT
and this method to allow the definition of pages without using any code,
just XML. Might be some good insight in that article you can use as well;
here, I just found it:

http://www.devarticles.com/c/a/ASP.N...rols-Using-XML
--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET

Nov 19 '05 #6
Hi Andrew,

Thanks for posting here. From my opinion, I also don't think dynamically
create server controls (or parse the string content with the asp.net
Parsing api) is not a good idea. Is it possible that you put all those
control declaratively? If there are cases that you can't get the definite
control items on the page, you can consider using some template databound
controls such as Repeater or DataList which can help generate a list of
control collections on the page according to the binded datasource.

In addition, after your page's dynamic content is generated, you can apply
the OutputCache on your page, this is a very important feature which can
help dynamic generated pages( content of which won't change frequently) be
serviced as quick as those static pages.

If there are any other ideas or questions, please feel free to post here.

Thanks & Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 19 '05 #7
Thanks for the clarification.

If the content is static, there's no need to store any code in your
database. Static HTML isn't code; it's text.

I suppose the best way to describe what I'm getting at is, let's say you ran
a restaurant, and you expected the National Tea Drinkers convention to come
to your restaurant next week. So, you figure you need to stok up on tea. So,
you go out an buy a dozen tea decanters and put them in your walk-in
refrigerator. But wait! You don't need more decanters. You already have
enough decanters. All you need is to store the tea. So, you decide instead
to buy a single 50-gallon drum, put that in your walk-in, and have more
walk-in space.

In other words, if the content is static, and you already have ASP.Net pages
and Controls (decanters) that can serve the content to the client, there's
no need to store any process at all in your database. All you need to store
is the "tea" - the data, or content.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Andrew Robinson" <ne****@nospam. nospam> wrote in message
news:uj******** ******@TK2MSFTN GP14.phx.gbl...
Ok, here is more or less what I am exploring....

We have a couple of web servers at a few hosting facilities. A few hundred
to a few thousand unique visitors per day. Nothing extraordinary here. And
in all fairness, our server hardware is likely overkill. Our web content
is
almost entirely static in nature. The current site is made up of about 150
pages.

The big issue is that while the content is static, it is being updated
every
few days. We have html and image updates that need to go live at critical
time intervals. The updates are all driven by advertising and marketing.
There is a lengthy approval process where the site gets posted to a
staging
server, approved by the powers that be and then it needs to go live at the
exact moment that advertising deems. Typically in the middle of the night
when the date rolls (and I am asleep).

I would like to explore putting content inside of SQL. The content can be
routed and approved as needed. Then replicated using either some type of
SQL
replication or some type of home grown Web Service push/pull method.

Give the appropriate data structure, the site can now make content live
when
the calendar rolls. I can put it up days in advance and not worry about
it.

As I said before, the content is almost entirely static. Some text and a
lot
of images and graphics. I was thinking of developing a set of custom
controls that would render text (html) or images and pull from SQL.

If I develop some type of Image and Text custom control that would be
pretty
simple and maybe I will leave it at that. But, I think about maybe having
pages that are recursively generated where a html controls pulls from SQL.
The pulled page may contain other controls that need to be rendered /
expanded.

-Andrew
"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:O1******** ******@TK2MSFTN GP15.phx.gbl...
> Given HTML text (likely from SQL), is there any method that could be
> employed to render server and/or custom controls that are contained inside > of that text? I would be loading content from a database and would like to > 'expand' the server controls. Possibly even recursively.


The answer is yes, but some things that CAN be done SHOULD not. You could
dig yourself a swimming pool with a spoon, but it wouldn't be a good idea

to
do so.

It seems to me that part of your problem is the way you view ASP.Net. It
sounds like you're coming from an ASP/Scripted/Procedural programming
background. Objects are not text, and you shouldn't treat them like text.
> If this is something that can't be done, I am looking at creating my
> own
> markup tags and searching for them with Regular Expressions. Then
> rendering
> them using my own custom classes. Does this seem like something that is
> 'way
> out there' or rather mainstream?


Heck, it can't be mainstream, because I don't even know what you're

talking
about. But it seems like you're trying to dig a swimming pool with a
spoon
again. What sort of requirement is this gerrymandered technique soupposed

to
fulfill?

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.

"Andrew Robinson" <ne****@nospam. nospam> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
> Given HTML text (likely from SQL), is there any method that could be
> employed to render server and/or custom controls that are contained inside > of that text? I would be loading content from a database and would like to > 'expand' the server controls. Possibly even recursively.
>
> Hope this makes sense, but I am guessing the answer is no.
>
> If this is something that can't be done, I am looking at creating my
> own
> markup tags and searching for them with Regular Expressions. Then
> rendering
> them using my own custom classes. Does this seem like something that is
> 'way
> out there' or rather mainstream?
>
> -Andrew
>
>



Nov 19 '05 #8

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

Similar topics

5
2376
by: K | last post by:
I have found a script online that I want to use (I am new to PHP). It creates dynamic images based on the text that you pass it. However, no matter how I try, I can't get anything other than a blank white image. Can one of you knowledgeable people please have a look at the code below and help please.
3
1312
by: Stephen Gennard | last post by:
Hello, I having a problem dynamically invoking a static method that takes a reference to a SByte*. If I do it directly it works just fine. Anyone any ideas why? I have include a example below... --
3
13714
by: Guy Harwood | last post by:
Hi, I have designed a textbox that inherits from the System.Windows.Forms.Textbox control. when the control is readonly the back color changes to a light blue to indicate that it is frozen. This all works well, but i would like the color to be configurable via the app.config file.
3
13753
by: NateDawg | last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if anyone has some input it would sure help me out. Ok, I’ve noticed a few gridview problems floating around the forum. Everyone wants to do a java confirmation box when a user clicks the delete button. Fair enough, basic user design rules state that you should always confirm a delete action. There is also a consensus that the best way to do this is a template...
7
22495
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We added an entry to the executable's .exe.config file to specify the URL, and under the 1.1 framework this worked well. Unfortunately, this is not working under the 2.0 framework. I see in the Reference.cs file under the web service reference the...
2
1647
by: serge calderara | last post by:
Dear all, Technically, what dynamic web page really means. Is it simply due to the fact that the content can be change without recompiling the web application by simply changing for example data base fields ? thnaks for your clarification regards
2
7696
by: dawg1998 | last post by:
I have a page that creates dynamic textboxes based on the number of fields a user chooses to fill out. This process worked great when the page was standalone. However, when I move to a Content/MasterPage setup, the MasterPage Form seems to be interfering with the ability of my code to retrieve the value in the dynamic control. Are there any ideas on why this is happening or how to work-around the problem? What is the syntax to find a...
2
2908
by: jitu78 | last post by:
Hi All, I am having problem with Pixel fonts in Flash. When I am using pixel fonts for dynamic contents, textual data is looking blurry. They are showing right with static content. That’s why I am using "Arial" for dynamic data. Here is my dynamic content,
7
8223
by: Jo | last post by:
Hi, How can i differentiate between static and dynamic allocated objects? For example: void SomeFunction1() { CObject *objectp = new CObject; CObject object;
9
2986
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I got the core of the javascript from here: http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm I noticed in the demo that sometimes the content takes a long
0
9345
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
10115
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9957
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...
1
9905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8780
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
7332
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
6609
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
5229
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...
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.