Rock.Web.UI.Controls.LocationPicker.OnLoad C# (CSharp) Method

OnLoad() protected method

Raises the E:System.Web.UI.Control.Load event.
protected OnLoad ( EventArgs e ) : void
e System.EventArgs The object that contains the event data.
return void
        protected override void OnLoad( EventArgs e )
        {
            base.OnLoad( e );

            EnsureChildControls();

            // set the "onclick" attributes manually so that we can consistently handle the postbacks even though they are coming from any of the 3 pickers
            string postBackScriptFormat = "$('#{2}').val('{1}');  __doPostBack('{0}','{1}');";

            _radNamed.Attributes["onclick"] = string.Format( postBackScriptFormat, this.UniqueID, "Named", _hfCurrentPickerMode.ClientID );
            _radAddress.Attributes["onclick"] = string.Format( postBackScriptFormat, this.UniqueID, "Address", _hfCurrentPickerMode.ClientID );
            _radPoint.Attributes["onclick"] = string.Format( postBackScriptFormat, this.UniqueID, "Point", _hfCurrentPickerMode.ClientID );
            _radPolygon.Attributes["onclick"] = string.Format( postBackScriptFormat, this.UniqueID, "Polygon", _hfCurrentPickerMode.ClientID );

            if ( Page.IsPostBack )
            {
                HandleModePostback();
            }
        }