I have ASP.NET Web Application Project.In which i want to Pass Value to a function in javascript from c# code-behind page.
My C# Code Snippet:-
//Here td_Output is TableCell
td_Output.Text = "<input type='button' style='font-size:11px;' onclick='LoadLoayaltyProgram(1,'"+Convert.ToString(Request.Form["Program"])+"');' class='ui-button ui-widget ui-state-default ui-corner-all' role='button' value='Add' />";
JavaScript Code :-
function LoadLoayaltyProgram(PID,ID) {
alert(PID +" "+ ID);
}
When i do Inspect Element on .aspx Page in browser i see code Like :
<input type="button" style="font-size:11px;" onclick="LoadLoayaltyProgram(1," pid112002');'="" class="ui-button ui-widget ui-state-default ui-corner-all" role="button" value="Add">
I am not getting any alert on click of "Add" button