What’s the Difference Between <%# i %> and <%= i %>?

 Posted by VIRENDRADUGAR on 9/21/2009 | Category: ASP.NET Interview questions | Views: 3283

We can use two constructs to access page-level variables in an ASP.NET web template:

data binding syntax
Data binding—the hierarchical mapping of control properties to data container
values—is specified by the <%# … %> tags. Code located within a <%# … %>
code block is only executed when the DataBindmethod of its parent control
container is invoked.

code rendering syntax
The <%= … %> code tags output content to the browser. This content could
be hard-coded, or it may contain page-level variables.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response