/// <summary> /// Raises the load event. /// </summary> /// <param name="e"> /// The <see cref="T:System.EventArgs" /> instance containing the event data. /// </param> /// <remarks> /// This method notifies the server control that it should perform actions common to each HTTP /// request for the page it is associated with, such as setting up a database query. At this /// stage in the page lifecycle, server controls in the hierarchy are created and initialized, /// view state is restored, and form controls reflect client-side data. Use the IsPostBack /// property to determine whether the page is being loaded in response to a client postback, /// or if it is being loaded and accessed for the first time. /// </remarks> protected override void OnLoad(EventArgs e) { Assert.ArgumentNotNull(e, "e"); base.OnLoad(e); if (Context.ClientPage.IsEvent) { return; } string item = base.LinkAttributes["url"]; if (base.LinkType != "external") { item = string.Empty; } string empty = string.Empty; string str = base.LinkAttributes["target"]; string linkTargetValue = LinkForm.GetLinkTargetValue(str); if (linkTargetValue == "Custom") { empty = str; this.CustomTarget.Disabled = false; this.CustomLabel.Disabled = false; } this.Text.Value = base.LinkAttributes["text"]; this.Url.Value = item; this.Target.Value = linkTargetValue; this.CustomTarget.Value = empty; this.Class.Value = base.LinkAttributes["class"]; this.Title.Value = base.LinkAttributes["title"]; this.CustomAttributes.Value = GetLinkValue(this.GetLink(), "customattributes"); this.Test.ToolTip = Translate.Text("Open the specified URL in a browser."); }
private void InitControls() { string goalValue = this.AnalyticsLinkAttributes[Attributes.goalid]; string eventValue = this.AnalyticsLinkAttributes[Attributes.eventid]; if (!string.IsNullOrWhiteSpace(goalValue)) { this.GoalId.Value = goalValue; } if (!string.IsNullOrWhiteSpace(eventValue)) { this.EventId.Value = eventValue; } string str = string.Empty; string linkAttribute = this.AnalyticsLinkAttributes[Attributes.target]; string linkTargetValue = LinkForm.GetLinkTargetValue(linkAttribute); if (linkTargetValue == "Custom") { str = linkAttribute; this.CustomTarget.Disabled = false; this.Custom.Class = string.Empty; } else { this.CustomTarget.Disabled = true; this.Custom.Class = "disabled"; } this.Text.Value = this.AnalyticsLinkAttributes[Attributes.text]; this.Target.Value = linkTargetValue; this.CustomTarget.Value = str; this.Class.Value = this.AnalyticsLinkAttributes[Attributes._class]; this.Querystring.Value = this.AnalyticsLinkAttributes[Attributes.querystring]; this.Title.Value = this.AnalyticsLinkAttributes[Attributes.title]; this.InitMediaLinkDataContext(); this.InitInternalLinkDataContext(); }