/// <summary> /// Gets the on click button HTML. /// </summary> /// <param name="handlerCode">The hander code.</param> /// <param name="imageUrl">The image URL.</param> /// <param name="text">The button text.</param> /// <param name="alternateText">Alternate image text</param> /// <returns></returns> public string GetOnClickButtonHtml(string handlerCode, string imageUrl, string text, string alternateText) { DynamicGridButton button = new DynamicGridButton(); if (!string.IsNullOrEmpty(imageUrl)) { button.ImageUrl = ControlHelper.GetFullImageUrl(imageUrl, Page); } button.OnClientClick = handlerCode; button.Text = text; button.AlternateText = alternateText; return(button.GetHTML()); }
/// <summary> /// Gets the button HTML. /// </summary> /// <param name="href">The href.</param> /// <param name="useNewWindow">if set to <c>true</c> [use new window].</param> /// <param name="imageUrl">The image URL.</param> /// <param name="alternateText">Alternate text of image</param> /// <returns></returns> private string GetButtonHtml(string href, bool useNewWindow, string imageUrl, string alternateText) { DynamicGridButton button = new DynamicGridButton(); button.NavigateUrl = JavaScriptBuilder.ConvertToJavaScriptLine(href); if (useNewWindow) { button.Target = "_blank"; } if (!string.IsNullOrEmpty(imageUrl)) { button.ImageUrl = ControlHelper.GetThemebleUrl(imageUrl, Page.Theme); } button.AlternateText = alternateText; return(button.GetHTML()); }