how to stop postback on button click in javascript

Posted by Fahadullah1 under ASP.NET on 11/6/2012 | Points: 10 | Views : 1708 | Status : [Member] | Replies : 2
I have a numeric pad from where I ask the user to enter the password by clicking the numbers from the numpad so,on every click page gets postback which delays the response so I waant to stop this..I have used a textbox as well in which numbers can be entered and on code behind page every button event is declares.Lets say if I click on button 1 it takes 1 as an input and so as 2 for button click 2.but I want to stop the post back.how???




Responses

Posted by: Krv on: 11/6/2012 [Member] Starter | Points: 25

Up
0
Down
a. Use html button


Thanks,
R.Vasanth
MCTS(SQL Server & BI)
http://bigdatatech.blogspot.com

Fahadullah1, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sourabh07 on: 11/6/2012 [Member] Starter | Points: 25

Up
0
Down
hi...

its better to use html buttons....

if again problem occurs then try to use javascript for this..

and OnClientClick event, execute the function written in the javascript which further returns false to restrict the button to occur the postback........

try this and let me know if it works or not...:-)

Sourabh07

Fahadullah1, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response