Solved

Calling an ASP.Net sub from an HTML Link

Posted on 2004-10-08
3
191 Views
Last Modified: 2012-06-21
Hi,

I'm pretty sure that because what I'm doing is client side as opposed to server side, its not actually possible. However, I thought I'd ask anyway! I'm trying to call an ASP.Net sub from an HTML link using the onClick method. When I do this, I get the undefined error (In my case "Submit" is undefined). What I'm trying to do is this: I have two buttons below a form which submit a username and password to be checked. The problem is that I did not want to use the regular styling of asp buttons, and so tried to use an <img> imbedded in a link to submit the form instead. Is this possible any other way? Thanks for your advice.
0
Comment
Question by:Screwi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
Thogek earned 150 total points
ID: 12264370
Try replacing your <img> tag with:

    <input type="image" src="yourImage.gif" />

More info at http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/input_image.asp
0
 

Author Comment

by:Screwi
ID: 12265657
Thanks, Thogek. I didn't exactly use your suggetion, instead I used the control <asp:imagebutton> but I only realised that was available when you mentioned the image input type. Anyway, thanks!
0
 
LVL 15

Expert Comment

by:Thogek
ID: 12269163
<asp:imagebutton> will result in a <input type="image"> tag being sent to the browser, so the two are roughly equivalent.

Just make sure that you have an actual need to reference the ImageButton on the server (such as in using its Click event) -- if so, then that's your tool; but if not, then you're using server resources (to instantiate the ImageButton object) that you don't need, and you'd be better off using a straight <input type="image"> tag.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

730 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