?
Solved

Calling an ASP.Net sub from an HTML Link

Posted on 2004-10-08
3
Medium Priority
?
197 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 450 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

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

771 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