ok, I'm working on a custom control that might contain some javascript, and read this on the page in the line box.
This is a workaround for dynamic javascript inside the update panel.
This works for me at the moment, but if I try to put the server tag inside the block:
<custom:control ID="Custom" runat="server"> <%= ControlName.ClientID %> </custom:control>
He doesn't like the compiler. I know that they are generated at runtime, and therefore may not be compatible with what I am doing, but does anyone know how I can do this?
EDIT
Error message: Code blocks in this context are not supported
EDIT 2
Control:
[DataBindingHandler("System.Web.UI.Design.TextDataBindingHandler, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), ControlValueProperty("Text"), DefaultProperty("Text"), ParseChildren(true, "Text"), AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] public class CustomControl : Control, ITextControl { [DefaultValue(""), Bindable(true), Localizable(true)] public string Text { get { return (string)(ViewState["Text"] ?? string.Empty); } set { ViewState["Text"] = value; } } }
source share