Solved

Calling an ASP.Net sub from an HTML Link

Posted on 2004-10-08
3
187 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
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

805 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