%#和<%=开放标签℃之间的区别是什么? [英] What is the difference between the <%# and <%= opening tags?

查看:283
本文介绍了%#和<%=开放标签℃之间的区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在编辑一个aspx文件,我发现用看似同样的事情,这两个打开的标签。是否有差异,如果是,是什么呢?

While editing an aspx file I found both these opening tags used for seemingly the same thing. Is there a difference and if yes, what is it?

推荐答案

<%= 是一个等同于<%Repsonse.Write ()

您可以在这里写任何内容,例如:

You can write any content out here: for example

<%=myProperty + " additional Text" %>

&LT;%#是一项具有约束力的前pression。你可以检索(在GridView的为例)当前上下文中的任何公共价值。但是你不能在这里混的内容。

<%# is a binding expression. You can retrieve any public value in the current context (for example in GridViews). But you cannot mix content here.

看看 MSDN 了解详情。

这篇关于%#和&lt;%=开放标签℃之间的区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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