jamesatha
jamesatha

Reputation: 7600

.ASPX syntax questions

I was reading an .aspx file to see how it works. In a few places I saw things like:

<%# GetName( Container ) %>

I was wondering what this does. Thanks

Upvotes: 0

Views: 231

Answers (2)

Ash Burlaczenko
Ash Burlaczenko

Reputation: 25435

<%# Used for Binding Expressions; such as Eval and Bind, most often found in data controls like GridView, Repeater, etc.:

From here http://naspinski.net/post/inline-aspnet-tags-sorting-them-all-out-(3c25242c-3c253d2c-3c252c-3c252c-etc).aspx

I've not seen it much. The must common is just <% or for outputing html use <%:

Hope this helps.

Upvotes: 0

Oded
Oded

Reputation: 498942

It is a data binding expression.

Data-binding expressions create bindings between a server control property and a data source

When you have called DataBind, the binding expressions get evaluated.

There are other <%%> types of expressions - see the links on the asp.net page syntax index page.

Upvotes: 2

Related Questions