Skip to content

Infragistics Community Forum / Web / Ultimate UI for ASP.NET Web Forms / Input type="image" causes a postback when clicked within WebDialogWindow

Input type="image" causes a postback when clicked within WebDialogWindow

New Discussion
jeff
jeff asked on Aug 1, 2008 5:35 PM

I have a webdialogwindow that contains an html <input type=”image”> element. When the image is clicked, it causes a postback to the server. Is there anyway to stop this postback from occurring? I have a client-side javascript function that is handling the onclick event. The content pane contains nothing but html (no asp or infragistics server controls).

 

Sign In to post a reply

Replies

  • 0
    [Infragistics] Murtaza Abdeali
    [Infragistics] Murtaza Abdeali answered on Aug 1, 2008 5:08 PM

    When input type="image" , it acts like a submit button and will cause a page to refresh. Try using this on the page itself, and you should see it causes a page refresh. If you want to perform client-only action using an image, you have two options.

    1. Return false from within the onclick method to stop post back.

    2. Use an img to display an image and hook an onclick event to it.

     

    I hope this helps.

    Taz.

    • 0
      jeff
      jeff answered on Aug 1, 2008 5:35 PM

      That did the trick. Thanks!

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
jeff
Favorites
0
Replies
2
Created On
Aug 01, 2008
Last Post
17 years, 7 months ago

Suggested Discussions

Created by

Created on

Aug 1, 2008 5:35 PM

Last activity on

Feb 23, 2026 1:36 PM