Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between <%# and <%= in ASP.NET MVC?

Tags:

c#

asp.net-mvc

What is the difference between <%# and <%= in ASPX inline code?

like image 287
Alex Avatar asked Jun 02 '09 22:06

Alex


People also ask

What is the difference between scriptlet <% %> and Declaration <%! %>?

Difference between JSP Scriptlet tag and Declaration tagThe jsp scriptlet tag can only declare variables not methods. The jsp declaration tag can declare variables as well as methods. The declaration of scriptlet tag is placed inside the _jspService() method.

What is the difference between scriptlet <%?

The scriptlet is everything inside the <% %> tags. Between these the user can add any valid Scriptlet i.e. any valid Java Code. In AppleScript, a scriptlet is a small script. In Windows, a scriptlet is COM component including a HTML code and a script which may be written in a variety of scripting languages.

What is a expression in JSP <%= %> <% %>?

A JSP expression is used to insert the value of a scripting language expression, converted into a string, into the data stream returned to the client.

What is the use of <% in JSP?

A scriptlet tag is used to execute java source code in JSP. Syntax is as follows: <% java source code %>


1 Answers

<%= is shorthand for Response.Write()

<%# is used to render data in databound controls

like image 145
Chris Van Opstal Avatar answered Oct 20 '22 22:10

Chris Van Opstal