数据库驱动页面 [英] Database Driven Pages

查看:50
本文介绍了数据库驱动页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[我是asp.net的新手]

我想创建一个网站内容由我的sql

数据库驱动。这将构成简单内容管理系统的基础。


即网址可以访问特定页面
www.xyz.com/default.aspx?pageid=34


当每个页面相同时,我可以实现这一点 - 例如包含我的自定义

text / html控件。


我遇到的问题是:

如何处理将我的其他自定义控件添加到一个页面而不是

另一个。


我想出的一种方式(看起来效率不高)是为了
在我写的每一个

控件的默认页面中都有某种逻辑:


即如果(数据库说这个页面包含xyz控件)

然后

(以编程方式将控件添加到指定位置的页面,按此顺序)


- 必须有比这更合乎逻辑且更有效的方法。而且我不是完全确定如何在

页面上处理控件的物理位置。


[我确实考虑过下网部分路线,(我的个性化

提供商确实考虑了查询字符串并将其视为单独的

页面)但是:

a)我真的不希望用户单独定制页面。

b)我还有一种方法是使用自定义文本/ html编辑器

web部分(在编辑模式下)允许用户''个性化'

文本,但我想将页面内容数据保存在我自己的表中在

数据库中,而不是在webparts /个性化表中。


如果我可以获取Web部件来存储文本的个性化信息

我的桌子,然后我想我可以阻止一个标准用户能够

个性化网站....?

我真的很感激任何评论/帮助任何人都可以给予,


JJ

[I''m fairly new to asp.net]
I want to create a web site with the page content being driven by my sql
database. This would form the basis of a simple content management system.

i.e. a particular page may be accessed by the url
www.xyz.com/default.aspx?pageid=34

I can achieve this when each page is identical - e.g. contains my custom
text/html control.

The bit I am having problems with is:
How do I deal with adding my other custom controls to one page and not
another.

The one way I could come up with (which doesn''t seem very efficient) is to
have some sort of logic built into the default page for each and every
control I write:

i.e. If (database says this page contains xyz control)
Then
(programmatically add control to page in location specifiied, in this order)

- there must be a more logical and efficient way than this. And I''m not
entirely sure how I''d deal with the physical location of the control on the
page.

[I did think about going down the web parts route, (my personalization
provider does take into account the querystring and treats it as a seperate
page) but:
a) I don''t really want a user to customise the pages individually.
b) I also though one approach was to use a custom text/html editor in the
web part (when in edit mode) to allow the user ''personalization'' of the
text, but I want to keep the page content data in my own tables in the
database and not in the webparts/personalization tables.

If I could get the web part to store the text peronalization information in
my tables, then I guess I could stop a standard user being able to
personalize the site....?]
I''d really appreciate any comments/help anyone can give,

JJ


推荐答案

4月16日,上午10:25,JJ < a ... @ xyz.comwrote:
On Apr 16, 10:25 am, "JJ" <a...@xyz.comwrote:

[我是asp.net的新手]

我想要创建一个网站,页面内容由我的sql

数据库驱动。这将构成简单内容管理系统的基础。


即urlwww.xyz.com/default.aspx?pageid=34
可以访问特定页面

我可以在每个页面相同时实现这一点 - 例如包含我的自定义

text / html控件。


我遇到的问题是:

如何处理将我的其他自定义控件添加到一个页面而不是

另一个。


我想出的一种方式(看起来效率不高)是为了
在我写的每一个

控件的默认页面中都有某种逻辑:


即如果(数据库说这个页面包含xyz控件)

然后

(以编程方式将控件添加到指定位置的页面,按此顺序)


- 必须有比这更合乎逻辑且更有效的方法。而且我不是完全确定如何在

页面上处理控件的物理位置。


[我确实考虑过下网部分路线,(我的个性化

提供商确实考虑了查询字符串并将其视为单独的

页面)但是:

a)我真的不希望用户单独定制页面。

b)我还有一种方法是使用自定义文本/ html编辑器

web部分(在编辑模式下)允许用户''个性化'

文本,但我想将页面内容数据保存在我自己的表中在

数据库中,而不是在webparts /个性化表中。


如果我可以获取Web部件来存储文本的个性化信息

我的桌子,然后我想我可以阻止一个标准用户能够

个性化网站....?]


我'真的很感谢任何评论/任何人都可以给予帮助,


JJ
[I''m fairly new to asp.net]
I want to create a web site with the page content being driven by my sql
database. This would form the basis of a simple content management system.

i.e. a particular page may be accessed by the urlwww.xyz.com/default.aspx?pageid=34

I can achieve this when each page is identical - e.g. contains my custom
text/html control.

The bit I am having problems with is:
How do I deal with adding my other custom controls to one page and not
another.

The one way I could come up with (which doesn''t seem very efficient) is to
have some sort of logic built into the default page for each and every
control I write:

i.e. If (database says this page contains xyz control)
Then
(programmatically add control to page in location specifiied, in this order)

- there must be a more logical and efficient way than this. And I''m not
entirely sure how I''d deal with the physical location of the control on the
page.

[I did think about going down the web parts route, (my personalization
provider does take into account the querystring and treats it as a seperate
page) but:
a) I don''t really want a user to customise the pages individually.
b) I also though one approach was to use a custom text/html editor in the
web part (when in edit mode) to allow the user ''personalization'' of the
text, but I want to keep the page content data in my own tables in the
database and not in the webparts/personalization tables.

If I could get the web part to store the text peronalization information in
my tables, then I guess I could stop a standard user being able to
personalize the site....?]

I''d really appreciate any comments/help anyone can give,

JJ



可能你可以看看微软的IBuySpy项目(或DNN -

DotNetNuke)其中用户控件用于创建动态页面

内容

Probably you can look at IBuySpy project from Microsoft (or DNN -
DotNetNuke) where user controls are used to create a dynamic page
content


您好Alexey。


我开始考虑DNN - 但是我发现它比我想要的要多得多了b / b
。我不希望编辑对网站有如此多的控制权!

我还希望在菜单/导航设计等方面有更大的灵活性。


另外我一直在网上寻找IBuySpy,但所有链接似乎都是

重定向到DNN网站....?


JJ

Hi Alexey.

I looked at DNN to start with - but I found that its much more than I want
to do. I don''t want editors to have that much control over the site!
I also want more flexibility over things like menu/navigation design.

Also I have been looking for IBuySpy on the net, but all the links seem to
redirect to DNN web site....?

JJ


>

可能你可以看看微软的IBuySpy项目(或DNN -

DotNetNuke)其中用户控件用于创建动态页面

content
>
Probably you can look at IBuySpy project from Microsoft (or DNN -
DotNetNuke) where user controls are used to create a dynamic page
content



" JJ" < ab*@xyz.com写在留言中

新闻:eo ************** @ TK2MSFTNGP02.phx.gbl ...
"JJ" <ab*@xyz.comwrote in message
news:eo**************@TK2MSFTNGP02.phx.gbl...

我还希望在菜单/导航设计等方面有更大的灵活性。
I also want more flexibility over things like menu/navigation design.



在这种情况下,建议您远离DotNetNuke ...

In which case, you''d be well advised to stay well away from DotNetNuke...


这篇关于数据库驱动页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆