Hi ,
I am not sure what is your requirement , try the below options.
Add reference to System.Web.Service assembly and define the code behind methods as Public methods , then attached Web Methods attribute to expose it.
using System.Web.Services;
namespace WebApplication1
{
public partial class WebForm1 : System.Web.UI.Page
{
[WebMethod]
public void testc()
{
Label38.Text = "work";
}
[WebMethod]
public void testd()
{
Label38.Text = "not work";
}
}
}
HTML code
<head runat="server">
<title></title>
<script type="text/javascript">
var myVar = setInterval(function () { myTimer() }, 1)
function myTimer() {
<%testc();%>
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label38" runat="server" >Apple</asp:Label>
</div>
</form>
</body>
</html>
If you are satisfied with the reply please accept and close the question.