hi
I am using the asp.net and C#.net and Javascript, I had written a function like "callmessage()" in javascript and now iam trying to call that function from C#.net
, i had tried in lot of ways , here i will write the sample code
case1:
<script type="text/javascript">
function callmessage1() {
alert('hello');
}
</script>
in serverside code in backend from C#.net
protected void Button1_Click(object sender, EventArgs e)
{ HttpContext.Current.Response.Write("<script>callmessage1();</script>");
ClientScript.RegisterClientScriptBlock(this.GetType(), "btn", "<script type = 'text/javascript'>callmessage1();</script>");
ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "CallJS", "callmessage1();", true);
}
this is not working
but when i do like this it was working
case2:
protected void Button1_Click(object sender, EventArgs e)
{
HttpContext.Current.Response.Write("<script>alert('its working');</script>");
ClientScript.RegisterClientScriptBlock(this.GetType(), "btn", "<script type = 'text/javascript'>alert('its working');</script>");
ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "CallJS", "alert('its working');", true);
}
can anyone please specify me the Mistake where i am doing , just i need to call the function,moreover in another project the same code is working , and i am getting the best result, but why in this project
anything i am missing...........
is there any chance of inline javascrift code in C#.net
Please help out from here
thank Q..!