using System.Collections.Specialized;
using System.ComponentModel;
+using System.Security.Permissions;
namespace System.Web.UI.WebControls {
+ // CAS
+ [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ [AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+ // attributes
[DefaultEvent("Click")]
#if NET_2_0
[Designer ("System.Web.UI.Design.WebControls.PreviewControlDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
-#endif
- public class ImageButton : Image, IPostBackDataHandler, IPostBackEventHandler
-#if NET_2_0
- , IButtonControl
+ [SupportsEventValidation]
+ public class ImageButton : Image, IPostBackDataHandler, IPostBackEventHandler, IButtonControl {
+#else
+ public class ImageButton : Image, IPostBackDataHandler, IPostBackEventHandler {
#endif
- {
-
private static readonly object ClickEvent = new object ();
private static readonly object CommandEvent = new object ();
private int pos_x, pos_y;
[WebCategory ("Behavior")]
#if NET_2_0
[Themeable (false)]
- public virtual
-#else
- public
#endif
- string CommandArgument {
+ public string CommandArgument {
get {
return ViewState.GetString ("CommandArgument", "");
}
[WebCategory ("Behavior")]
#if NET_2_0
[Themeable (false)]
- public virtual
-#else
- public
#endif
- string CommandName {
+ public string CommandName {
get {
return ViewState.GetString ("CommandName", "");
}
#endif
[DefaultValue ("")]
[Editor ("System.Web.UI.Design.UrlEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
- [MonoTODO]
- public virtual string PostBackUrl
- {
+ public virtual string PostBackUrl {
get {
- throw new NotImplementedException ();
+ return ViewState.GetString ("PostBackUrl", String.Empty);
}
set {
- throw new NotImplementedException ();
+ ViewState["PostBackUrl"] = value;
}
}
}
#if NET_2_0
- [MonoTODO]
protected virtual PostBackOptions GetPostBackOptions ()
{
- throw new NotImplementedException ();
+ return new PostBackOptions(this, PostBackUrl, null, false, true,
+ false, true, CausesValidation,
+ ValidationGroup);
}
#endif