The PerButton from the ASP.NET AJAX SDK allows users to add an image to the button. Of course, if you want to add a background image to the button, this PerButton also offers related property setting APIs.
In following text, we will offer detailed C#.NET programming codes for users to create and customize image button in ASP.NET web application. Before running the sample C# codes listed below, in order to achieve the AJAX effect, please drag an AjaxPanel component from toolbox to aspx web page and then drag a button control from toolbox to that AjaxPanel. After you finish these preparing works, you can modify the button properties in the aspx.cs file. ImageUrl
ImageUrl: by setting ImageUrl property to the location of the image that you are going to use, you can easily display an image on the button. This is the easiest way to add an image to the button. PerButton1.Image.ImageUrl = "../../../Images/Button/Timer.jpg"; IsBackgroundImage
IsBackgroundImage: If you set this property to true, the defined image will be used as the background of the target button. PerButton1.Image.IsBackgroundImage = true; Event url
Event Url: If you want to show a different image on the button in specific situations, you can call following three events.
PerButton1.Image.DisabledImageUrl = "../../../Images/Button/Timer2.jpg"; | ![]() ASP.NET AJAX UI Controls ASP.NET AJAX Chart UI Control ASP.NET AJAX Grid UI Control ASP.NET AJAX Barcode UI Control ASP.NET AJAX Button UI Control OverviewGetting StartedButton Type Standard ButtonIcon ButtonImage ButtonLink ButtonToggle ButtonSplit ButtonClient Prpgramming Button EventServer Programming Button EventASP.NET AJAX Calendar UI Control ASP.NET AJAX NavigationBar UI Control ASP.NET AJAX Captcha UI Control ASP.NET AJAX Color Editor UI Control ASP.NET AJAX ComboBox UI Control ASP.NET AJAX DataPager UI Control ASP.NET AJAX Dock UI Control ASP.NET AJAX DropDownList UI Control ASP.NET AJAX DropDownTree UI Control ASP.NET AJAX HtmlEditor UI Control ASP.NET AJAX FileManager UI Control ASP.NET AJAX Filter UI Control ASP.NET AJAX Input UI Control ASP.NET AJAX ListBox UI Control ASP.NET AJAX ListView UI Control ASP.NET AJAX ToolBar UI Control ASP.NET AJAX TabControl UI Control ASP.NET AJAX Menu UI Control ASP.NET AJAX ToolTip UI Control |