Click here to Skip to main content
15,885,077 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In Run mode i have gridview as follows


Selectbatchdate

12th may 2015
15th may 2015
16th june 2015
Linkbutton

In run mode when i click the link button it will be postback.

for that how to prevent the postback in link button

for that how can i do in asp.net using c#
Posted

1 solution

If you don't want a post back then don't use a link button as that is its only use.

XML
<asp:LinkButton ID="MyLink" runat="server" OnClientClick="someJsFunction(); return false;" Text="Link button" />

<script type="text/javascript">
    function someJsFunction()
    {
        alert('Hello');
    }
</script>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900