Homam
Homam

Reputation: 23851

How to bind with a static property

I want to bind with a static property in my application, is that possible?

I've tried this:

<asp:ListItem Enabled="<%$ MyNamespace:myClassName, MyBooleanPropertyName  %>">

And the following message is appeared:

Parser Error Message: The expression prefix 'MyNamespace' was not recognized. Please correct the prefix or register the prefix in the section of configuration.

Thanks in advance

Upvotes: 0

Views: 370

Answers (1)

Akram Shahda
Akram Shahda

Reputation: 14781

Use the following format to bind to a static property:

Property="<%# MyNamespace.myClassName.MyBooleanPropertyName  %>"

Upvotes: 2

Related Questions