<%=和<%之间的差异:

问题描述:

我正在攻读我的网络开发考试,我对何时使用<%= vs<%感到困惑:我的许多练习测试都包含了这两个选项作为anwer的问题,但他们都没有真正解释何时或为何使用这两者。我一直在查看我的书,而且他们都没有真正清楚的解释。有人可以向我解释一下吗?谢谢。

I'm studying for my web development exam, and I am confused about when to use <%= vs <%: Many of my practice tests have included questions with both of these options as an anwer, but none of them really explained when or why to use either. I've been looking through my books and none of them really have a clear explanation. Can somebody please explain this to me? Thanks.

朋友,

  根据我的理解 我们使用的第一个其中的表达式返回一个字符串值,需要在HTML中的位置移位或定位。后者我们习惯用HTML编码。就像在那里调用HtmlEncode
方法一样。

Friend,
  As per my understanding first one we uses for where the expression in that is returning a string value and need to displaced or positioned in that place in HTML. The latter we used to get it HTML encoded. It is just like calling a HtmlEncode method there.