473,406 Members | 2,698 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,406 software developers and data experts.

Dynamically rendering ASP.NET code

Hi,

I want to store .aspx code in a database for easier management, editing etc.
(for a CMS-ish application)

Is this feasible without getting into massive amounts of trouble? The
codebehind will be static and on the filesystem, it's only the .aspx content
I want to be able to change (several, if not all, pages can share the same
simple codebehind for most content).

Any tips and suggestions would be greatly appreciated. Perhaps I'm heading
in the wrong direction here, if so, I'd still be thankful for any other tips
which would give me approximately the same functionality.

I though about creating my own XML format, then manually parsing the tags in
the e.g. "cms"-namespace. (which effectively would let the users write any
xml-compliant html code mixed with our own "<cms:"-style tags, which would
be replaced by e.g. server controls) - but I figured this would be too much
work...

Let's say I have the following .aspx code stored in a string variable:

<body>
<asp:Label id="Label1" />
</body>

I would then want to specify (in code) what class that WebForm should derive
from, and thus letting that class set the properties for Label1 (assuming
Label1 is defined in the class).
Thanks,
Nils Magnus Englund
Nov 18 '05 #1
1 989
"Scott Simons" <Scott.Simons.At.MealMagic.Com.Remove.This> wrote in message
news:72**********************************@microsof t.com...
I think I understand what you are trying to do, but am not sure. In any
case, if the code behind would be the same the only thing you could really
change in the aspx files would be the layout. Don't waste your time with
this, use stylesheets. If each user needs a different layout think of
ways
to allow each user to create their own stylesheet.


Actually, in addition to the layout, I would be able to change the content
(which would be plain text in the .aspx). I was hoping to let the user add
tags like e.g. <my:SomethingDynamic key="value" /> (which would be replaced
by some nifty dynamic content in the client output).

The "user" in this scenario would be the people able to modify the .aspx
code in the database, but not mess with the codebehind.

The .aspx pages would only be the middle content, as I use some sort of
templating around it - so layout-wise, the changes would only be very
moderate.
Sincerely,
Nils Magnus Englund
Nov 18 '05 #2

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

Similar topics

4
by: Stuart Perryman | last post by:
Hi, I have code that is creating tables dynamically. For some reason unbeknown to me, the attributes 'rowspan' and 'colspan' are being ignored in IE 6.02 on XP SP2 In Firefox the behaviour is...
1
by: | last post by:
In Actionscript 2.0 there is the concept of dynamically generating and naming objects at runtime. Dynamically named objects can be referenced and manipulated programmatically using array-access...
12
by: Jerad Rose | last post by:
I searched for a while trying to find the answer to this, but to no avail. I am trying to find the best way (or any way) to dynamically show and hide groups of TR's. For example, I have a...
5
by: Rick Spiewak | last post by:
I need to generate a "buy" button as part of an ASP.NET page - this consists of a small HTML form with hidden fields, conforming to the requirements of a merchant credit card processor. PayPal is...
2
by: Colin McGuigan | last post by:
This is a translation of an ASP page to ASP.Net. First, the background: The goal is to have a grid of different settings for the application -- think something along the lines of the Property...
6
by: Nathan Sokalski | last post by:
I am trying to dynamically add controls to my page, but am having trouble with controls such as buttons. I have been able to add simple controls such as Label controls, because they can be placed...
9
by: Yama | last post by:
Hi, How can I dynamically embed the content of a filename.js into a .aspx page before rendering it to the client? Thanks, ~yamazed
0
by: yohaas | last post by:
I am dynamically adding user control to a page using Controls.Add(control). It seems that the Page_Load as well as the other page rendering events (Init, PreRender etc...) get fired twice. I...
15
by: tom | last post by:
why delete the dynamically allocated memory twice causes an error, see the code below: int _tmain(int argc, _TCHAR* argv) { int *pi = new int(12); cout<<*pi; delete pi; delete pi; }
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.