IHttpHandler

How far away is support for IHttpHandlers?

Since I have the normal VS IntelliSense turned off (in favour of R# IntelliSense),
this means that when editing a httphandler, you get basically zero help.
VS becomes a glorified text editor. Very frustrating! The only way around
it at the moment that I've found is to basically create a class file (.cs),
write the code in there, and then copy it into the httphandler (.ashx) before
I compile.

Surely since a IHttpHandler is little more than a class file, adding support
couldn't be terribly difficult? Or, is there some way to get ReSharper to
treat files with an .ashx file extention the same as treating a .cs file?


7 comments
Comment actions Permalink

Hi

You can always keep your ASHX file with a single line of code and implement
IHttpHandler in a class library.

<%@ WebHandler Language="C#"
Class="YorClassNameImplementedElsewhere"
%>


Yuriy

How far away is support for IHttpHandlers?

Since I have the normal VS IntelliSense turned off (in favour of R#
IntelliSense), this means that when editing a httphandler, you get
basically zero help. VS becomes a glorified text editor. Very
frustrating! The only way around it at the moment that I've found is
to basically create a class file (.cs), write the code in there, and
then copy it into the httphandler (.ashx) before I compile.

Surely since a IHttpHandler is little more than a class file, adding
support couldn't be terribly difficult? Or, is there some way to get
ReSharper to treat files with an .ashx file extention the same as
treating a .cs file?



0
Comment actions Permalink

Gerrod,

I will check it ASAP, whether it's possible to support it at the same level
as .aspx files without SIGNIFICANT effort. If it is, the support will be
added to the first build in the new year. Anyway, I'll keep You informed.
--
Sergey V. Coox
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

Gerrod,

Unfortunately, I failed to find proper description of .ashx files.
Am I right saying, that in fact they are normal C# files, which contain
headers like
<% @ WebHandler language="C#" %> or
<% @ WebHandler language="C#"
codebehind="myhandler.cs" %>

And what is desired is normal ReSharper's functionality over the body of the
file?

--
Sergey V. Coox
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

Hi Sergey -

Am I right saying, that in fact they are normal C# files, which
contain
headers like
<% @ WebHandler language="C#" %> or
<% @ WebHandler language="C#"
codebehind="myhandler.cs" %>


As far as I know, you're absolutely right. I've never done one with a CodeBehind, though. I've attached an example of a handler to this message for you.

With so much noise being made about AJAX programming, Handlers offer a great way to implement an endpoint for a request - as such I can see many more people implementing them as time goes by. (At least, that's what I use them for :-D).

And what is desired is normal ReSharper's functionality over the body
of the file?


Well as you said, it's just a C# class with an additional header, basically. So it would be cool if R# could effectively treat the file like a .cs file. The only extra functionality that I can think of would be to ensure that the "Class" attribute in the header matches the namespace/classname in the file:

<%@ WebHandler Language="C#" Class="Unsd.Mi.Web.Handlers.DataSeriesHandler" %>

namespace Unsd.Mi.Web.Handlers {
public class DataSeriesHandler : IHttpHandler {
//....
}
}

But that's fairly trivial - just getting the normal support for a .cs file would be more than ample for me!

Thanks -
/gerrod



Attachment(s):
DataSeriesHandler.ashx
0
Comment actions Permalink

Gerrod,

Thanks a lot, we will support .ashx files as normal .cs files by the first
build in the new year (we plan to make a new build today, but it's
impossible to catch up with it). I don't promise the checking for a class
name, though.

--
Sergey V. Coox
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

Gerrod,

Thanks a lot, we will support .ashx files as normal .cs files by the
first build in the new year (we plan to make a new build today, but
it's impossible to catch up with it). I don't promise the checking
for a class name, though.


That's awesome - thanks!

Cheers -
/gerrod


0
Comment actions Permalink

Thomas,

Done. The next build will contain the desired functionality.
--
Sergey V. Coox
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


0

Please sign in to leave a comment.