How to pass a value from WinForm (C#) to an altogether separate Javascript client chat application -
i have chat application in have client side(javascript) , server-side winforms. want pass value frmconsole.cs file converse.js file. there way can achieve this? using xmpp protocol connecting client , operator console , have own ejabberd server running same. example want pass string c# code javascript file:
private string getstringvalue() { return "a string value"; }
and javascript side code:
<script language="javascript" type="text/javascript"> var stringvalue = '<%=getstringvalue();%>'; alert(stringvalue); </script>
i tried not throwing expected alert. in alert shows
<%=getstringvalue();%>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script type="text/javascript"> function showstring(){ var stringvalue = '<%=getstringvalue();%>'; alert(stringvalue); </script>
main body:
scriptmanager.registerclientscriptblock(this, this.gettype(), "javascript", "javascript:showstring();", true);
Comments
Post a Comment