Learn how to a build a cloud-first strategyRegister Now


How do I to assign a submit event to a clicked image

Posted on 2006-05-21
Medium Priority
Last Modified: 2010-04-16
I want to have an image as a submit rather than the grey submit button.  The code that I have for the submit button now is:

private void cmdLogin_ServerClick(object sender, System.EventArgs e)
      if (ValidateUser(txtUserName.Value,txtUserPass.Value) )
            Response.Redirect("logon.aspx", true);

Do I need to right-click on the image and run it as a server control?  How do I assign the piece of code above to that image being clicked?
Question by:michael1174
LVL 10

Accepted Solution

prakash_prk earned 375 total points
ID: 16731656
u can use the ImageButton Web Server Control.

set the ImageUrl property of the image button.

add the above code to the image button's click event.



Author Comment

ID: 16765641
Thank you!

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question