ASP.Net MVC & Comet (WebSync)

2.6k Views Asked by At

I'm trying to implement comet in my ASP.Net MVC 2.0 project. I'm using WebSync from FrozenMountain. My website is coded in C# 4.0 and ASP.Net 4.0.

The comet code is triggering my MVC controller function with the [HttpPost] attribute (even though the page doesn't refresh or appear to post). Is there a way to determine what is being posted and ignore that route in my global.asax.cs?

  • Please note, I know how to ignore routes with MVC, that is not the issue.
2

There are 2 best solutions below

1
On BEST ANSWER

The gentlemen at Frozen Mountain helped me solve the problem here

It was hitting one of my MVC controller functions. I had to add this to my global.asax.cs

routes.IgnoreRoute("{*allashx}", new {allashx=@".*\.ashx(/.*)?"}); 
0
On

In WebSync 4, you can skip the .ashx handler altogether and just add a route for WebSync directly in Global.asax:

WebSyncServer.AddRoute("...");