asp.net<%$ ...%>句法 [英] asp.net <%$ ... %> syntax

查看:96
本文介绍了asp.net<%$ ...%>句法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从Java切换到.NET。

I'm trying to make the switch from Java to .NET.

我已经注意到了一些ASP.NET页面都<%$ sometext%GT; 在其中。谁能解释这是什么做的一两句,或点我的语法参考?

I've noticed a number of ASP.NET pages have <%$ sometext %> in them. Can someone explain what this does in a couple of sentences, or point me to a reference on the syntax?

推荐答案

这是前pression建设者语法,而且它通常用于访问设置在的web.config 。下面是使用前pression建设者语法得到一个连接字符串的例子:

It's expression builder syntax, and it's used commonly to access settings in the web.config. Here's an example using expression builder syntax to get a connection string:

ConnectionString="<%$ ConnectionStrings:sqlconnection %>"

下面的解释所有的内联前pressions的好文章:

http://support.microsoft.com/kb/976112

Here's a good article that explains all of the inline expressions:
http://support.microsoft.com/kb/976112

这位前pression建设者用来设置基于包含在应用程序的配置或资源文件中的信息控制属性的值。以下是前pression建设者的基本语法:
  &LT;%$例pression preFIX:防爆pression值%GT;
  美元符号( $ )指示ASP.NET下列前pression是一个前pression建设者。这位前pression preFIX定义了一种前pression,如AppSettings的,的ConnectionStrings,或资源。此外,您可以创建和定义自己的前$ ​​P $ pssion建设者。后面的冒号前的pression值()是ASP.NET实际上将有一定属性的值用

The expression builder is used to set values of control properties based on the information that is contained in an application's configuration or resource files. The following is the basic syntax of the expression builder: <%$ Expression Prefix: Expression Value %> The dollar sign ($) indicates to ASP.NET that the following expression is an expression builder. The expression prefix defines the kind of expression, such as AppSettings, ConnectionStrings, or Resources. Additionally, you can create and define your own expression builder. The expression value that follows the colon (:) is what ASP.NET will actually use as the value of a certain property.

这篇关于asp.net&LT;%$ ...%&GT;句法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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