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 :) 

Comments

Popular posts from this blog

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 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 .

Programming Languages Ranking | Feb 2015 | JavaScript Greatest Performance

This is my second post along the blog speaking about programming languages ranking according to  TIOBE  for software quanlity. Before heading off to speak about the ranking, I would like to point out that this rank is based on the amount of searches and content availiable on the web for each programming language, You can read the full definition of TIOBE index  here .