Hi,
This is what i did:
in the item_datatbound event of the repeater:
Label lblFirstName = (Label) e.Item.FindControl("lblFirstName");
Button btnMoveUser =(Button)e.Item.FindControl("btnMoveUser");
btnMoveUser.Attributes.Add("onclick","return moveUser('" + lblFirstName.ClientID.ToString() +"');");
in the aspx page:
please note this is inside the repeater
<asp:Button id="btnMoveUser" text="Move User" runat="server" onclick=" moveUser(' lblFirstName_Vert.ClientID ');" /></td>
Javascript:
function moveUser(lblID)
{
var lbl = document.getElementById('lblId');
alert(lbl);
var answer=confirm("Are you sure you want to move this candidate" + lblID.value +"?");
if(answer)
return true;
else
return false;
}
But im getting an error in the aspx page stating: Too many characters in character literal
i tried the following but they too were showing error:
onclick=" moveUser(lblFirstName_Vert.ClientID);" Error: ) expected
onclick=' moveUser(lblFirstName_Vert.ClientID);" Error: ) expected
What could be the solution
Thanks