ASP.NET inline expressions

<% … %> Embedded Code Blocks in ASP.NET Web Pages

Server tags cannot contain <% … %> constructs
The code in the block can execute programming statements and call functions in the current page class during the page-rendering phase.

<%@ Page Language="VB" %>
<html>
<body>
 <form id="form1" runat="server">
 <% For i As Integer = 16 To 24 Step 2%>
 <div style="font-size: <% Response.Write(i)%>">
 Hello World<br />
 </div>
 <% Next%>
 </form>
</body>
</html>

<%= … %> displaying expression

equivalent of the embedded code block that contains only the Response.Write(…) statement. This is the simplest way to display information such as a single string, an int variable, or a constant.
displaying expression cannot be used in the attributes of server controls. This is because the .NET Framework directly compiles the whole expression instead of the displaying content as the value to the attribute.

<%@ Page Language="VB" %>
<html>
<body>
 <form id="form1" runat="server">
 <%=DateTime.Now.ToString() %>
 </form>
</body>
</html>

<%@ … %> directive expression

<%# … %> data-binding expression

The data-binding expression creates binding between a server control property and a data source when the control’s DataBind method of this server control is called on the page.

<%$ … %> expression builder

More information regarding to ASP.NET expression can be found ASP.NET Expressions Overview  and ExpressionBuilder Class.

<%– … — %> server-side comments block

<!– #include file|virtual=”filename” –> Server-Side Include Directive Syntax

More information:

Introduction to ASP.NET inline expressions in the .NET Framework

Advertisements

ASP.NET AJAX / Microsoft AJAX is dead?

While reading the book “Programming Microsoft ASP.NET MVC by Dino Esposito (May 14, 2010)”, I learned client side data binding.

The technology mentioned in the book is Microsoft Ajax / ASP.NET Ajax and the Sys.UI.DataView component. I want to try it out myself, but i can barely find any documentation online, not to mention any official.

After google for “Is asp.net ajax dead?”, I find lots of blog posts to indicate that Jquery is the first choice right now.

If anyone is interested in the original posts, below is the link.

http://stephenwalther.com/blog/archive/2010/03/16/microsoft-jquery-and-templating.aspx

http://weblogs.asp.net/toddanglin/archive/2010/04/19/microsoft-ajax-client-library-is-dead-long-live-jquery.aspx

http://jclaes.blogspot.com/2010/04/state-of-client-side-aspnet-ajax-40.html

http://encosia.com/understanding-jquerys-impact-on-microsoft-and-asp-net/

http://stackoverflow.com/questions/4250637/is-the-asp-net-ajax-library-dead