1

I'm trying to open popup window when i click on image button in asp.net website, but when i click on image button the pop up window shows up for like one seconds and then disappears.when i use tag, it shows the pop up window, but when i try with the other way, it disappears. Am i missing something in the code.

 <div id="cover"></div>
 <div id="dialog">
My Dialog Content
<br><input type="text">
<br><input type="button" value="Submit">
<br><a href="#" onclick="closePopUp('dialog');">[Close]</a>
</div>
<a href="#" onclick="showPopUp('dialog');">Show</a>
<asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="~/slika/PLUS.gif" onClientClick="showPopUp('dialog');"  />
user1408956
  • 109
  • 2
  • 6
  • 18

1 Answers1

1

Clicking on ImageButton causes postback - that reloads the page with no popup shown. This link describes a way to have an ImageButton that does not cause form submision : Can I create an ASP.NET ImageButton that doesn't postback?

onClientClick="showPopUp('dialog');return false;"
Community
  • 1
  • 1
Igor
  • 15,833
  • 1
  • 27
  • 32