Skip to main content

How to Use ImageButton Control By C# ASP.NET

Hello Geeks .. Today's Post Is A Simple Example On How To Use The Image Button Control in ASP.NET Using C# .
So Before We Dive Into Our little post , let me give You a Brief Description About This Control .
Well .. Image Button Control Is a Control That Displays An Image Instead Of Text .
You Can Find This Control Within the System.Web.UI.WebControls namespace.
You Can Use This Control To Map Images and Get Co-ordinations for example .


Some Properties Of The ImageButton :

  • PostBackUrl : Set the Url Of The Web Page to Post from the current web page when the ImageButton is Clicked 
  • CauseValidation : set a value showing whether or not validation is performed when the ImageButton control is clicked.
  • OnClientClick : Set The Client Side Script Which Is Executed When An ImageButton Control Click Event is Fired. 

Download Working Sample (Media Fire ) : ImageButton ASP.NET Sample

Steps For Implementing The Code Yourself : 

  1. Open Visual Studio 2012 And Create An Empty ASP.NET Web Application .
  2. Right Click On The Solution Explorer .. Add New Item .. Web Form .

  3. Add The HTML Code inside the webform.aspx I just gave you the link to download
  4. Go To The ImageButton Click Event and Implement This Code : 
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
               Result.Text ="X="+e.X.ToString() + ",Y=" + e.Y.ToString(); 
        }

Related Posts : 

Best Wishes Everybody :) 

Popular posts from this blog

How To Create A Change Password Form in a C# Application

Hello Geeks .. This little post is a free sample C# Windows Form that can be used to change password in a SQL Database .

C# Full Pharmacy Project With Source code

Hello Geeks .. This post is one of our completely Free Projects .. It is a Pharmacy Project that can perform a lot of operations you can also find the (.dll) files for the working Barcode Reader Machines in your country and add it to the project .


How To Create C# Chat Application

Hello Geeks .. Today I gonna show you How to make a Chat Application Using Microsoft C#.NET 5.0 .
You Can Use Older Versions Since there is nothing special in the application that only belongs to C# 5.0 .

This Application Was Created To Allow Two Computers To "Chat" Using IP Addresses Also you Can Open two Clients On The Same Computer and Use Same IP Address But Different Port.. It is simple and Easy to Use And Develop .. I also Uploaded The Full Working Project With It's Source Code On MediaFire.. You Will Find The Link At The End Of the Post :)