jparlato
asked on
My link to http handler is requiring me to use /...../xxx.ashx in my link????
<link href='/httphandlers/GetCus tomCSS.ash x' rel='stylesheet' type='text/css' />
I'm using the link above to access a http handler that I wrote and is located in my mvc folder under /httphandlers/...
I don't understand why I have to use the path /httphandlers/getCustomCSS .ashx to access this but, if I don't - I get a 404 not found.
The web config has it registered correctly as: <add name="GetCustomCSS" path="GetCustomCSS.ashx" verb="GET" type="Portal.HttpHandlers. GetCustomC SS" />
I should be able to link to this using:
<link href='GetCustomCSS.ashx' rel='stylesheet' type='text/css' />
but I cannot get this to work... It is just a minor issue but, I just don't understand why this is the case. Every example I see, does not require you to use a path, after you register the mapping... so what is up? Is it because the handler is contained in the httphandles folder of the mvc app? or what?
I'm using the link above to access a http handler that I wrote and is located in my mvc folder under /httphandlers/...
I don't understand why I have to use the path /httphandlers/getCustomCSS
The web config has it registered correctly as: <add name="GetCustomCSS" path="GetCustomCSS.ashx" verb="GET" type="Portal.HttpHandlers.
I should be able to link to this using:
<link href='GetCustomCSS.ashx' rel='stylesheet' type='text/css' />
but I cannot get this to work... It is just a minor issue but, I just don't understand why this is the case. Every example I see, does not require you to use a path, after you register the mapping... so what is up? Is it because the handler is contained in the httphandles folder of the mvc app? or what?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok, but what is the point of registering this as follows:
<add name="GetCustomCSS" path="GetCustomCSS.ashx" verb="GET" type="Portal.HttpHandlers. GetCustomC SS" />
since this is MVC all .cs files should be compiled into the bin/assembly, right? Why doesn't it find this namespace in the assembly. I guess you may be correct, but do you know why it confuses me that I give this namepace, only to have to then give a path to find what is a .cs file... that should be compiled... Just want to understand what is going on.
<add name="GetCustomCSS" path="GetCustomCSS.ashx" verb="GET" type="Portal.HttpHandlers.
since this is MVC all .cs files should be compiled into the bin/assembly, right? Why doesn't it find this namespace in the assembly. I guess you may be correct, but do you know why it confuses me that I give this namepace, only to have to then give a path to find what is a .cs file... that should be compiled... Just want to understand what is going on.
ASKER
<link href='/GetCustomCSS.ashx' rel='stylesheet' type='text/css' />
Again, I don't know whaty the / is being required ....
Shouldn't it work with just:
<link href='GetCustomCSS.ashx' rel='stylesheet' type='text/css' />