using <%= %> or <%# %> with runat=server in ASP.NET
问题 I have a web control that looks like this public class Foo : WebControl { [Bindable(true)] [Category("Default")] [DefaultValue("")] [Localizable(true)] public string Bar { get; set; } protected override void Render(HtmlTextWriter output) { output.WriteLine(Bar); } } I want to put this webcontrol in my aspx page like so: <cc1:Foo Bar="<%= Fa.La.La %>/otherstuff" runat="server" /> (obviously this code is simplified to show the problem) In my Render method the variable Fa.La.La is not evaluated.