Expression on html "client" control?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi , when I apply expression on a pure HTML control , like<img src=<%$
resources:...% > , I got a compilation error and said this is not allowed
,after I add "runat=server", the problem is fixed.But it's kind of ugly since
it will unnecessarily consume some of CPU cycles to process in the asp.net
engine. I'm not sure if there is a way to get it work?

Appreciate any help.
 
you can move the expression to the code-behind as a property of the page

Then --
<img src="<%= PropertyName.% >"> will do it
 
Thanks Swanand, It looks like <%$ expression is second-class citizen. Your
approach is great except that I want to keep page authoring away from
code-behind.--In my company , we want to keep the page more declarative way.
 
Back
Top