When you click the element which this aspect is attached to, you will retrieve the coordinates on the server
By default it will capture the absolute x,y position on the entire viewport, but if you want to only capture
x,y relative to the aspects parent container you can set this value to true.
Namespace:
Gaia.WebWidgetsAssembly: Gaia.WebWidgets (in Gaia.WebWidgets.dll) Version: 3.6.0.0 (3.6.0.0)
Syntax
Examples
protected void Page_Load(object sender, EventArgs e) { InitAspectClickableUsingTopLeft(); Panel innerPanel = new Panel(); innerPanel.Style["position"] = "absolute"; innerPanel.Style["border"] = "1px solid black"; innerPanel.Style["width"] = "25px"; innerPanel.Style["height"] = "25px"; innerPanel.Visible = false; zPanel.Controls.Add(innerPanel); } private void InitAspectClickableUsingTopLeft() { WebWidgets.AspectClickable aspectClickable = new WebWidgets.AspectClickable(); aspectClickable.UseRelativeCoordinates = true; aspectClickable.Clicked += clickable_Clicked; zPanel.Aspects.Add(aspectClickable); } void clickable_Clicked(object sender, WebWidgets.AspectClickable.ClickEventArgs e) { // note: left+top is not persisted in viewstate and therefore gets reset after each callback Panel innerPanel = WebUtility.First<Panel>(zPanel.Controls); innerPanel.Style["left"] = e.Left + "px"; innerPanel.Style["top"] = e.Top + "px"; innerPanel.Visible = true; }
