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 .

Microsoft Interview - MSP Windows 8 Vertical

Hello Geeks ..It seems to be my return to posting starting today , and i will start by telling about the Interview i just had in Microsoft for MSP - Club . You first need to know that questions are both technical and social , they need to know the real you , weather you understand what you are saying or not , weather you know your limits and able to control it or not . I applied for Microsoft Windows 8 vertical  to be a Microsoft Partner Presenter in my college . MSP Club - Windows 8 Vertical