On the aspx code, for the concerned button write
OnClientClick="return false;"
This will stop posting back the page. If you need to do some function call, like validation etc, you can do that too.
OnClientClick="MyFunction(); return false;"
Define a function which stores value in some variable
MyFunction()
{
myVariable = myVariable + "number you got from button";
return false;
}
If you need to do conditional stopping of postback you can write like
OnClientClick="MyFunction();"
And define function like
function MyFunction()
{
if (condition == true)
return false;
else
return true;
}
In this case, if condition is true, it will NOT post back else it will post back.
Hope that helps. If it does, mark it as solution/upvote.
Thanks
Milind