在ASP.NET应用程序中使用XML配置 [英] Using xml config in ASP.NET application

查看:135
本文介绍了在ASP.NET应用程序中使用XML配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是个良好的编程方式使用XML配置文件建立动态Web界面与数据绑定,事件等。

Is it a good programming way to use xml config file for building dynamic web interface with databinding, events etc ..?

<Sub Name="Matrix Report" Url="frmGridReportPanel.aspx">    
    <Report  Name="Repor Name" src="ConnectionStr" Url="frmGridReportPanel.aspx">
              <DataSource>
                <Server Type="Table">View_REPORT1</Server>
                <Client>null</Client>
              </DataSource>
              <FIELDS>
                <FIELD type="DropDownList" id="Table_ID" name="Table_Field_name" required="true">
                  <LOOKUP>MyTable</LOOKUP>
                  <DIMENSION>Table_ID</DIMENSION>
                  <DATATYPE>Int</DATATYPE>
                  <LENGTH>12</LENGTH>
                  <OPERATOR>=</OPERATOR>
                </FIELD>
                .....
              </FIELDS>
            </Report>
    ....
    <Sub/>

这是我的XML。
我怎么能配置事件TRIGER的控制。

This is my xml. How i can configure the event triger for the controls.

是否有使用XML congig文件构建任何开源动态地在网页?

任何想法?

推荐答案

在某些平台上,XML配置文件是规范(例如,.NET)。

On some platforms, XML configuration files are the norm (for example, .NET).

使用XML可以帮助,如果你让你的元素和属性名有意义的,但需要一个解析器和/或解串器,以获得到内存中。

Using XML can help if you make your element and attribute names meaningful, however will require a parser and/or deserializer in order to get into memory.

如果这是太多的开销,你可以使用其他方法(简单的键 - 值对在一个文件中,最喜欢的UNIX配置文件)。

If this is too much overhead, you can use other methods (simple key-value pairs in a file, like most unix configuration files).

因此​​,有没有具体的最佳实践 - 最佳实践遵循使用平台/语言使用的标准

As such, there is no specific "best practice" - best practice it to follow the standard used in the platform/language you use.

我不明白这是什么但是有做数据绑定,事件和建立一个动态网站。

I am not clear what that has to do with databinding, events and building a dynamic web site, however.

至于您的具体要求 - 动态报表工具栏,我会说一个配置文件可能是一个不错的选择。这取决于数据的数量,以及是否应被同步到另一数据存储

As for your specific requirement - a dynamic reporting toolbar, I would say a config file could be a good fit. It depends on the amount of data and whether it should be synchronized to another data store.

如果大部分的过滤器中的值需要由动态的,因为他们应该从数据库中对应的值,我也不会从数据库中使用的配置,但得到的数据。

If most of the values for the filters need to by dynamic since they should correspond to values from a database, I would not use a config, but get the data from the database.

这篇关于在ASP.NET应用程序中使用XML配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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