Question: Below are my environment settings 

* SQL Server 2008 R2
* ASP.NET MVC
* Entity Framework

In my application I want to do post processing of transaction after they are inserted in database. So basically I want a separate application to be listening to database events, and whenever a new row is created in table `Orders`, do some post processing (calling another webservice to process orders) on it.

I checked with EF and it seems it doesn't provide any such feature.

**Few other requirements**

* at this moment i am not looking for solution involving polling as it will increase db load.
* Want some kind of event to get triggered when a row is inserted.

What would be the best way to achieve the same?

Answer: 
You have to specifically tell the webpage to execute your function when it's loaded.

Instead of returning the string I believe you'd like to write it in the body of the webpage.

This is a simple way to do so :

```
<html>
    <head>
        <script>
            var myFunction = function(){
                document.body.innerHTML = "hello world";
            }
        </script>
    </head>
    <body onload='myFunction();'>
    </body>
</html>

```
Try this

```
<html>
<head>
</head>
<body onload='myFunction()'>

<script type="text/javascript">
    var myFunction = function(){
       return "hello world";
    }
</script>

</body>
</html>

```