Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When should <%# ... %> and <%= ... %> be used?

Tags:

.net

asp.net

I have been doing some work lately with a Pre-compiled .NET3.5 app so i have had to write alot of inline code and i was just wondering about the usage of the # and = and niether when doing inline code?

like image 789
dkarzon Avatar asked Mar 17 '09 05:03

dkarzon


2 Answers

  • <%= is the equivalent of Response.Write()
  • <%# is for Binding Expressions on Data Bound controls.
  • <%$ to access AppSettings, ConnectionStrings and other values contained within an application's configuration and resource files
like image 148
Christian C. Salvadó Avatar answered Oct 02 '22 00:10

Christian C. Salvadó


I posted a similar question here, this might give you some things to look at:

ASP.NET "special" tags

Especially this page:

http://quickstarts.asp.net/QuickStartv20/aspnet/doc/pages/syntax.aspx

like image 30
Andy White Avatar answered Oct 02 '22 00:10

Andy White