i want to push data to user browser if an event happens on browser. with commet programming we can do this.
http://en.wikipedia.org/wiki/Comet_%28programming%29
are any good tutorials available on net??
you should try PokeIn comet ajax library for ASP.NET
Check out WebSync, a full comet server for .NET.
There are lots of tutorials available too.
There seem to be a lot of Comet related projects on GitHub: http://github.com/search?q=comet&type=Repositories&x=0&y=0. I don't see any that are ASP.NET or C#, but you can get an idea of how things work from the other implementations.
I think the best place to start is the Ajax Patterns page on Comet. Also, you might want to have a look at Dojo's CometD project. I've been playing with comet a bit, but there are some browser (as well as server) bugs that makes it inherently difficult, along with the fact that comet is directly opposite to the intended usage of HTTP (client sends request, server responds).
There is an open source ASP.NET comet implementation called aspComet on GitHub. The solution comes with a sample chat project you could check out to get started.
Related
im currently debugging a larger asp.net mvc solution.
Now I'm pretty sure that a API call that is made serverside in c# is returning some kind of faulty value. The problem is though, the project has a LOT of api calls that looks like each other.
When i debug websites in the browser, I've gotten used to using the browsers developer tools "network" tab to view all external calls to API's done by javascript, and methods in the solution.
Is there some way to get a overview of all api calls that happens in c#/serverside, as they happen?
Getting overview of asp.net c# api calls
VS IDE does not have such option to view all the apis that are called during debugging.
But some VS extensions may realize it. You can try Fiddler extension, PostSharp extension or use Runtime Flow(thanks to Sergey for sharing it).
In addition, you can try to use encoding method like enable System.NET logging and get its request. See this net framework network trace and net core trace.
If these do not meet your requirements, you could suggest a feature on our User Voice Forum.(click Suggest a Feature).
After that, you could share the link with us here and anyone who is interested in it including us will vote it so that it will get more Microsoft's attention.
i m developing an application in asp.net 3.5 using mvc2. i want to implement facebook like notification system based on server push or comet. i have no idea where and what to start with. i have read about Pokein but don't know how to integrate it with mvc. any suggestions are held highly
thanks
Adeel
There are sample MVC projects for PokeIn library (visit here). On the other hand, PokeIn is a good choice in comparison to other alternatives. (License costs, event ordering, disconnection detection, "reverse ajax" support etc)..
Also, you may need to check the documentation for PokeIn here
Check out WebSync, a comet framework for .NET. Easy to use, lots of examples...should do what you want.
See also:
ASP.Net MVC & Comet (WebSync)
Does anyone know of a good article or tutorial on the Internet demonstrating the use of GWT leveraging a (ASP.NET) web service cross domain?
To my knowledge, interacting with either XML or JSON should be possible from GWT, but becomes a lot more difficult when the web service is on a different domain. I've tried finding an article that demonstrates this setup, but without any luck.
There are a few options available:
use the Cross Site linker - it should make cross domain request easier, simply add <set-linker name="xs"/> in your module file (*.gwt.xml)
window.name hack :) Be sure to read the post with the original dojo proposal
JSONP
many others ;)
But first I recommend reading http://code.google.com/webtoolkit/tutorials/1.6/Xsite.html - it should get you going :)
I was initially going for a JSONP approach (as suggested by Google), in order to do cross site AJAX calls in JavaScript, but ended up with too many hacks that I had to incorporate into the ASP.NET web service in order for it to work.
The solution, in my case, was instead to use GWT RPC to a JAVA servlet, acting as a proxy, which then would call the ASP.NET Web Service using SOAP. The SOAP Java classes was generated using the wslist tool that is part of JAX-WS project (as demonstrated here).
Using the GWT RPC, I was still able to call the JAVA servlet asynchronously, giving the user a seamless experience.
I've heard Jeff and Joel discuss on a podcast what they called a "Heartbeat" which essentially is creating something that acts similar to running a windows service in an website. I was hoping to get some more insight into how something like this would be implemented. Has anyone implemented something like this before and what did you use it for?
Thanks!
I found the answer in a combination of places. I took what Jeff Attwood did for stackoverlow here as well as the Code Project article and made something that is completely reusable and able to easily be hooked up using an IoC tool. I've posted the full details here
Basically you use a web page to kick off a process... but you put a cap on how often the process can run.
Something like this:
TimeSpan timeSinceLastRun = DateTime.Now.Subtract(lastRunTime);
if(timeSinceLastRun > interval) {
RunCustomProcess();
lastRunTime = DateTime.Now;
}
this way you just have to ensure that occasionally someone (or some program) visits the page. Hitting the page many times won't adversely affect your process..
This Code project article: Simulate a Windows Service using ASP.NET to run scheduled jobs, explains it all.
You can use ASP.NET Health Monitoring and wire up something to WebHeartbeatEvent.
We are implementing something like that between the client and server, as we have windows forms client and WCF service acts as a server.
The aim of the heartbeat is to sayd "I am still alive" from the server side.
Check this link for introduction for Heartbeat in WCF
I'm planning a ASP.NET project for which I'm going to use AJAX. I'm researching all the available technologies for doing so in the .NET world.
I need a solution that is well documented and stable.
The current solutions I've found are:
1. ASP.NET AJAX UpdatePanel
2. ASP.NET AJAX with Web Services + JQuery
3. JQuery + Http Handlers
In the second and third solutions the backend would only send JSON or XML messages to the client.
In my experience the best way to go is JQuery with WCF with JSON webservices.
The reason is:
ASP.NET ajax is gives you alot for free in terms of coding but is bloated from the start and needs to be stipted and slimed. On the other hand you have JQuery that you needs more development but is light weight. JQuery has a great plugin library as well.
XML is to slow, JSON is fast.
Thats how I would do it today.
All will work but I've had most performance and stability with using JQuery and a script service.
An update panel will work but as its designed to work in the general case it can be a little bloated if you aren't careful. One reason being is that it posts the viewstate back with each update.
I recommend you check out the site: encosia.com as it has a number of posts on how to use script services and page methods. Then you can make a more informed decision. I would say that I've not used page methods and probably won't but that's entirely for personal reasons.
One other thing to consider will be any mvc you may end up doing. The general consensus is that it's a whole lot easier with JQuery. Added to that Microsoft have officially adopted it and also provide intellisense in VS2008.
All compelling reasons to include at least some of it in your project. In mine I only use the built in ScriptManager when I absolutely have to.
HTH!
S