Folks....can u tell me how to pass an argument to the Javascript function written in source thru Code behind...??
here is my code:
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
function message(name)
{
alert("Hello" + name)
}
</script>
</head>
In my code behind file :
btnok.Attributes.Add("Onclick", "message();"); // HOW TO PASS
ARGUMENT TO THIS FUNCTION MESSAGE ?? SO THAT WHEN USER ENTERS THE NAME IN TEXT BOX EG. CHARLIE....AND CLICK ON OK
IT SHOULD GIVE OUTPUT HELLO CHARLIE ??
SECONDLY , IF I CLICK ONCE MY FUNCTION DOES NOT GET EXECUTED , I NEED TO CLICK 2 TIMES WHY SOOO ??
AWATING REPLY.
CYA
ROHAN