Jan 20, 2015, 7:54 PM
[CLOSED] Inheriting from Ext Component HTML property
I created a custom control that inherits from Ext.Net.Component. The control simply overrides the Html property to allow for HtmlEncoding for XSS prevention. I notice that with a normal Ext.Net.Component, when you update Html property during a direct event, it sends back script to update the UI. With my custom control, it doesn't. What governs that? Do I need to specify the same property attributes as in the base class?
my Custom control:
my Custom control:
Public Class SafeComponent
Inherits Ext.Net.Component
Public Property DisableEncoding As Boolean
Public Overrides Property Html As String
Get
Return MyBase.Html
End Get
Set(value As String)
MyBase.Html = If(Me.DisableEncoding, value, System.Web.HttpUtility.HtmlEncode(value))
End Set
End Property
End Class
Base class Html property[Meta]
[Description("An HTML fragment, or a DomHelper specification to use as the layout element content (defaults to '')")]
[DirectEventUpdate(MethodName = "Update")]
[ConfigOption("html")]
[Category("3. AbstractComponent")]
[DefaultValue("")]
[NotifyParentProperty(true)]
public virtual string Html
{
get
{
return this.State.Get<string>("Html", "");
}
set
{
this.State.Set("Html", (object) value);
}
}
Last edited by Daniil; Jan 30, 2015 at 1:44 PM.
Reason: [CLOSED]