hi, i have found a solution to calling code behind function but it does not work if i put the call statement in a loop
Javascript
C#
if i put the <%SetData();% >; in a loop it only executes once.....please help
Javascript
Code:
<script language="javascript">
function init()
{
alert('hello ');
<%SetData();%>; //------------------------------> main line
alert('<%=strName%>');
}
</script>
Code:
private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
this.ImageButton1.Attributes.Add("onclick",
"javascript:init();");
}
}
public void SetData()
{
strName = "mainpico";
}
Comment