Hi Steven
C# is complied language not just interpreted script language as JavaScript
Therefore, i don't think you can do that , the opossite is easy however.
Mohamed M .Mahfouz
Developer Support Engineer
ITWorx on behalf of Microsoft EMEA GTSC
In one of the webiste I have seen something like this to call C# function
from Javascript :
--------------------------------------------------------
<script language="javascript">
function init()
{
alert('hello ');
<%SetData();%>; //------------------------------> main line
alert('<%=strName%>');
}
</script>
-------------------------------------------------------
private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
this.ImageButton1.Attributes.Add("onclick",
"javascript:init();");
}
}
public void SetData()
{
strName = "mainpico";
}
But when I try to replicate the same .. I'm getting error in the main line.
How can I achieve the same?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.