简体   繁体   中英

Click of Button doing postback

Iam using MS Visual developer 2010 Express Edition (Free).

I have a repeater control with toggle function with edit,update,save Link buttons.Every thing was working fine until today

Now I changed the appearence of LINK buttons to Buttons(by setting border style to outset,colour..etc) inside the repeater and added image buttons instead of other buttons outside the repeater.I have used vb.net ,Javascript for doing various functions

And my issue is when ever i click a button,image button or even a link button inside the repeater the form is doing a post back.How can i stop the postback in this case.It looks like flashing for each click of button.How can i resolve this issue

Requesting for help.. Thanks

add to the asp control: OnClientClick="return false;"

this will prevent the postback.

hope that helps.

You need to add return false; in that button onclick and onclientclick event

see this sample's like

Add onclick="return false;" in link button

<asp:LinkButton ID="someID" onclick="return false;" runat="server" Text="clicky"></asp:LinkButton>

The image button have , set return false;

<asp:imagebutton OnClientClick="YourFunction(); return false;"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM