Chris Geo February 2016
aspx button prevent postback onclick (c#)
The code below shows some HTML with a
<asp:Button ID="CalculateG481" runat="server" Text="Calculate" OnClick="CalculateG481_Click" />
This calls the function
CalculateG481_Click but then posts back.
I have tried using
OnClientClick="return false" but this simply prevents the button from executing
I have also tried
OnClick="CalculateG481_Click; return false;" as well to no avail.
CalculateG481_Click is a C# Codebehind function.
alec February 2016
Win February 2016
You can either use regular input html tag with pure Client-Side calculation or Server Button Control with Ajax based on your requirement.
Easiest way is to use Ajax UpdatePanel, and place everything inside it.
Asked in February 2016
Viewed 3,717 times
Answered 2 times
Leave an answer
Quote of the day: live life