Click here to Skip to main content
15,888,454 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Which event appears the value of sessions variables Pin
Kornfeld Eliyahu Peter3-Aug-14 20:37
professionalKornfeld Eliyahu Peter3-Aug-14 20:37 
GeneralRe: Which event appears the value of sessions variables Pin
danigeraleddin4-Aug-14 3:52
danigeraleddin4-Aug-14 3:52 
Suggestion[Repost] Which event appears the value of sessions variables Pin
Richard Deeming4-Aug-14 2:32
mveRichard Deeming4-Aug-14 2:32 
GeneralRe: [Repost] Which event appears the value of sessions variables Pin
danigeraleddin4-Aug-14 3:46
danigeraleddin4-Aug-14 3:46 
QuestionAdjusting "Session-Time-Out-Warning-Message" to be suitable for Master/Content Pages Pin
Member 1098429531-Jul-14 13:45
Member 1098429531-Jul-14 13:45 
SuggestionRe: Adjusting "Session-Time-Out-Warning-Message" to be suitable for Master/Content Pages Pin
Richard Deeming1-Aug-14 2:06
mveRichard Deeming1-Aug-14 2:06 
QuestionAdding *.js Routes to *.aspx Files Pin
Skippums31-Jul-14 7:54
Skippums31-Jul-14 7:54 
AnswerRe: Adding *.js Routes to *.aspx Files Pin
Richard Deeming31-Jul-14 9:11
mveRichard Deeming31-Jul-14 9:11 
The issue is that IIS sees a request for a *.js file, which isn't mapped to an ASP.NET handler, and so it doesn't invoke the ASP.NET pipeline. The routing module never gets the chance to see the request and route it to your real handler.

There seem to be three basic options to fix this:

1. runAllManagedModulesForAllRequests="true"
Modify your web.config to tell IIS to invoke the full ASP.NET pipeline on every request.
XML
<system.webServer>
  <modules runAllManagedModulesForAllRequests="true" />
</system.webServer>


This will potentially have an impact on the performance of your site.


2. Remove the preCondition on the UrlRoutingModule-4.0 module.
XML
<system.webServer>
  <modules>
    <remove name="UrlRoutingModule-4.0" />
    <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
  </modules>
</system.webServer>


The performance impact won't be as great as option 1, but there will still be an impact, as the routing module will now fire for every request to the site.


3. Custom handlers
Explicitly map the requests to an ASP.NET handler:

XML
<system.webServer>
  <handlers>
    <add 
        name="dynamic-js" verb="GET,HEAD" path="scripts/*/*.js"
        type="DynamicScripts.CustomScriptHandler, DynamicScripts" 
        preCondition="integratedMode"
    />
  </handlers>
</system.webServer>


This will have better performance that the other two options. The down-side is that you have to create an IHttpHandler or IHttpHandlerFactory class to handle the requests.

You might be able to get away with using System.Web.UI.PageHandlerFactory, but I haven't tested it. Smile | :)

http://svenaelterman.wordpress.com/2011/01/31/using-asp-net-4-0-extension-less-routing-on-iis-7-5/[^]
http://www.hanselman.com/blog/BackToBasicsDynamicImageGenerationASPNETControllersRoutingIHttpHandlersAndRunAllManagedModulesForAllRequests.aspx[^]



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


QuestionSilverlight Integration like Bespoke Digital Media using Asp.NET? Pin
mailmeat30-Jul-14 21:47
mailmeat30-Jul-14 21:47 
Questionasp.net project Pin
Dhruvesh Hotha30-Jul-14 10:59
Dhruvesh Hotha30-Jul-14 10:59 
AnswerRe: asp.net project Pin
Richard MacCutchan30-Jul-14 20:55
mveRichard MacCutchan30-Jul-14 20:55 
AnswerRe: asp.net project Pin
Sibeesh KV29-Sep-14 1:45
professionalSibeesh KV29-Sep-14 1:45 
QuestionASP.net Ajax CalendarExtender in gridview can't set BehaviorID (Two components with the same id '{BehaviorID}' can't be added to the application) Pin
VietNameseHue29-Jul-14 23:27
VietNameseHue29-Jul-14 23:27 
QuestionASP.NET MVC create custom search form Pin
medodesign29-Jul-14 8:57
medodesign29-Jul-14 8:57 
SuggestionRe: ASP.NET MVC create custom search form Pin
Richard Deeming29-Jul-14 9:18
mveRichard Deeming29-Jul-14 9:18 
QuestionHow to Upload Directory Pin
Samarjeet Singh@india29-Jul-14 4:51
Samarjeet Singh@india29-Jul-14 4:51 
AnswerRe: How to Upload Directory Pin
jkirkerx29-Jul-14 7:55
professionaljkirkerx29-Jul-14 7:55 
QuestionRe: How to Upload Directory Pin
ZurdoDev29-Jul-14 8:09
professionalZurdoDev29-Jul-14 8:09 
JokeRe: How to Upload Directory Pin
Kornfeld Eliyahu Peter29-Jul-14 10:16
professionalKornfeld Eliyahu Peter29-Jul-14 10:16 
GeneralRe: How to Upload Directory Pin
ZurdoDev29-Jul-14 10:20
professionalZurdoDev29-Jul-14 10:20 
AnswerRe: How to Upload Directory Pin
meeram3929-Jul-14 18:31
professionalmeeram3929-Jul-14 18:31 
AnswerRe: How to Upload Directory Pin
jkirkerx30-Jul-14 10:05
professionaljkirkerx30-Jul-14 10:05 
AnswerRe: How to Upload Directory Pin
Nathan Minier1-Aug-14 4:04
professionalNathan Minier1-Aug-14 4:04 
QuestionRandom 8 digit number Pin
byka28-Jul-14 4:55
byka28-Jul-14 4:55 
AnswerRe: Random 8 digit number Pin
Richard Deeming28-Jul-14 5:26
mveRichard Deeming28-Jul-14 5:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.