Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6906313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:17:38+00:00 2026-05-27T08:17:38+00:00

Is there any mechanism that I can push data into a webbrowser control from

  • 0

Is there any mechanism that I can push data into a webbrowser control from the containing windows forms application. Specifically the webbrowser control contains some knockout.js and I want to allow some external events such as changes to certain files in the local filesystem to update the knockout viewModel.

At the moment I have this working after a fashion with the JS in the webbrowser control issuing a longpolling jsonp requests to a micro webserver I have written running in the windows forms application (note that this is not the place that the web page itself is server from hence jsonp. Also, the micro webserver is basically just a httpListner). When the forms app receives a file change event it returns a response via the micro webserver and that updates the knockout viewmodel.

The problem is this all feels fragile – if the file events come thick and fast they can start being skipped – it looks like my micro webserver is trying to return multiple results to the same stream. I can fix that, but overall its looking nasty and fragile.

The question is: am I missing any much simpler way to have the containing application signal something (i.e. pass some JSON) to the web page running in a webbrowsercontrol (without a page refresh!)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:17:39+00:00Added an answer on May 27, 2026 at 8:17 am

    You could create an element, say a div with an id

    <div id='external-json' data-bind='jsonHandler : {}' style='display:none'></div>
    

    Then write json to this div from within your winforms app..

    var myJson = "{test : 1}";
    this.browser.Document.Body.GetElementById("external-json").innerText = myJson; 
    

    You could even create a knockout custom binding to react to this

        ko.bindingHandlers.jsonHandler = {
            update: function(element, valueAccessor) {
            //do something with the json
            var json = element.innerText;
            var obj = eval(json); //hmm
            alert(obj.test); 
        }
    };
    

    This is obviously a simple example and you could probably improve the idea a lot, you may need a queue of messages, possibly calling a function in your client script instead of using the element.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any mechanism in C# that allows one to define and declare an
When using route names, for example with Url.RouteUrl , is there any mechanism that
Is there any mechanism where I can get update notification when users try to
Is there any 'hack' that can be applied to do client-side image processing with
Is there any existing mechanism by which I can add an event listener to
Is there any free or commercial component written in .NET (no COM interop) that
Is there any query which can return me the number of revisions made to
Is there any way to capture the MouseDown even from the .NET 2.0 TextBox
Is there any mechanism for doing a JOIN between an in-memory collection and entity
I'm trying to push packets of data from my HTTP server to a browser,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.