c# - How to access button in an item template of an asp.net "gridview" using Javascript? -
i relatively new programmer. have gridview in button repeated every row.this button item template. when user clicks button, textbox colums value should changed using javascript. tried. going perfect. when click button in row of grid, text of textbox of row changed disappears. looks posting back. how stop this??
onclientclick ="myfunct(this)"
function myfunc(x){ var id=x.id; var newid = id.substring(0, 18); newid+="textbox1"; document.getelementbyid(newid).value="ghjhghjg"; } regards
ok found answer. need return false onclientclick prevent postback.
function myfunc(x){ var id=x.id; var newid = id.substring(0, 18); newid+="textbox1"; document.getelementbyid(newid).value="ghjhghjg"; return false; } onclientclick="return myfunc()"
thats it
Comments
Post a Comment