c# - error executing child request for server.transfer with Handler -
i have created handler process .html pages in asp.net c# web application. use url rewriting concepts.
handler works fine when html requrest come server/website. coding details follows:
web.config handler code:
<add verb="*" path="*.html," validate="false" type="myproject.contenthandler,myproject" />
contenthandler.cs code:
public void processrequest(httpcontext context) { string strmappage = string.empty; if (context.request.url.tostring().contains("category")) { strmappage = "/links.aspx?id=" + producid; } else { strmappage = context.request.url.tostring(); } context.server.transfer(strmappage); }
this method works fine .html request page http://localhost:9111/user-category-1.html when try open page '/js/tinymce/imagemanager/index.html'
throws error "error executing child request /js/tinymce/imagemanager/index.html"
how solve problem?
from microsoft:
microsoft internet information services (iis) dispatches server.transfer or server.execute request appropriate internet server application programming interface (isapi) extension based on extension of requesting file. example, request .aspx page dispatched aspnet_isapi.dll isapi extension.
after request dispatched appropriate isapi extension, isapi extension cannot call isapi extension. receive error message "error executing child request pagename.asp" because aspnet_isapi.dll file, handles requests asp.net pages, cannot forward request asp.dll file, handles requests asp pages.
your haldler creating problem,
try this: caused custom http handler being added application being run in root of web site. resolve problem, modify web.config file. after add:
<httphandlers> <clear /> <add verb="*" path="*.aspx" type="system.web.ui.pagehandlerfactory" /> </httphandlers>
Comments
Post a Comment