Skip to content

ASP.Net Socket Programming

khushbu chikani

Asked Jan 27, 2015, 11:28 PM EST2 answers
Share
LinkedInX
I want to implement communication between windows service and asp.net web page.for that i m using tcp socket programming.But when i send something from windows service to asp.net page,it is received by the asp.net application but i am not able to update any control of that page.
please help me in this metter 

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Pranay Rana
    0
    For this scenario you have to use push notification...i.e. you need to use feature of HTML5 called EventSource which is useful for pushing notification to html pages


    Example :

    var source = new EventSource("demo_sse.php");
    source.onmessage = function(event) {
        document.getElementById("result").innerHTML += event.data + "<br>";
    };

    when you careate EventSoruce like as above it will listen to the changes on that page for Asp.net you can also provide web Api or handler as input to EventSource and get refeshed data in onmessage function.

    For more detail you can also search on google for EventSoruce
    0
  • 0
    hello thank u for your prompt reply....but when i add window.EventSource('index.aspx') in my page it gives me error that JavaScript runtime error: Object doesn't support this action
    i think it is due to older version of html...is there any solution for this??
    0