views:

2072

answers:

1

Hi All,

im trying to use a file upload control from the obout control library, i really like it, and think its quite slick without any flash!..

i downloaded the entire installer, played with the settings in the samples, and made the control act exactly as i wanted.

i created a brand new web application ins vs2008, and included the web.config, dlls, and folders with style code, as well as the aspx page that i had tweaked to give me the desired output.

i built the new project, and ran it, the control loaded, and works fine.


now i want to use this in the already existing project that i have been working on, so i copied the web.config values, the dlls, and the folders with the style code and the aspx page that i tweaked..

i put them in the same locations i did with the other project, built it and ran the page.. everything loaded however when i clicked on a button i got a webresource.axd error, 2 actually, both with encryption at the end.

after doing some research, it looks like the webresource.axd can be used to dynamically load javasript and css files etc... soo my guess at this point is the control uses this as a hidden way to include javascript files it requires.. and its failing on those includes.. which baffles me.

i have stripped out everything from my project, and it is still failing, i found an article that stated it could be the iis configuration of the site, so i checked, i have the mapping to the .net 2.0 lib file, with the axd extension.. so i doubt that was the issue, however i did delete and recreate the iis site.. and it still does not work...

i have included this line as well in the web config..

<add verb="GET" path="WebResource.axd" type="System.Web.Handlers.AssemblyResourceLoader" validate="true"/>

this also did not seem to help..

does anyone know where i can go with this?...

EDIT: i came across this in the event viewer..

Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 05/05/2009 2:38:16 PM 
Event time (UTC): 05/05/2009 6:38:16 PM 
Event ID: 8579dbce2f5844169b1740bb95ebffb1 
Event sequence: 8 
Event occurrence: 1 
Event detail code: 0 

Application information: 
    Application domain: /LM/W3SVC/1/Root/SVN_WORKSPACE/WWWROOT/WorkEstimateSystem-12-128860222914549340 
    Trust level: Full 
    Application Virtual Path: /SVN_WORKSPACE/WWWROOT/WorkEstimateSystem 
    Application Path: c:\inetpub\wwwroot\SVN_WORKSPACE\WWWROOT\WorkEstimateSystem\ 
    Machine name: GREGE6500 

Process information: 
    Process ID: 2276 
    Process name: aspnet_wp.exe 
    Account name: GREGE6500\ASPNET 

Exception information: 
    Exception type: HttpException 
    Exception message: Session state is not available in this context. 

Request information: 
    Request URL: http://localhost/SVN_WORKSPACE/WWWROOT/WorkEstimateSystem/WebResource.axd?d=gPWI1Nyst2kh_ORsvV-AHCh4GSmizSjDuHRCpBgAKBsmi1Zr6e44K950Zcfsdc4p2GuNTPmRl4yAADV0USSNLFQQ7sk-iY1WVt4JJWJE_yg1&amp;t=633771228432707325 
    Request path: /SVN_WORKSPACE/WWWROOT/WorkEstimateSystem/WebResource.axd 
    User host address: 127.0.0.1 
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: GREGE6500\ASPNET 

Thread information: 
    Thread ID: 8 
    Thread account name: GREGE6500\ASPNET 
    Is impersonating: False 
    Stack trace:    at System.Web.HttpApplication.get_Session()
   at GlobalClass.CURRENT_EMPLOYEE_ID()
   at GlobalClass.checkLogin(String pagerequested)
   at GlobalClass.Application_OnPostRequestHandlerExecute(Object sender, EventArgs e)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Custom event details: 

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

the global.asax has some session start and end functions as well as application start and end functions.. is there any way to simply say if request is coming from an axd do something different or dont run these custom functions?

FIXED:

inside the global.asax page..

    Sub Application_OnPostRequestHandlerExecute(ByVal sender As Object, ByVal e As EventArgs)
select case requestedPageName
   case "webResource.axd"
    exit sub

this fixed it!

+4  A: 

The "Application_OnPostRequestHandlerExecute" method runs for ever request that .Net handles. This includes "webresource.axd". In that method, check to see if the current URL is "webresource.axd". If it is, then don't use the session.

David
thanks david! this is awsome.. i wished i and checked my event logs sooner!!
Greg R
"check to see if the current URL is "webresource.axd". If it is, then don't use the session"Can you please explain more!Thanx!
Soni Ali
@Soni: take a look at the edited part of the question. Greg stopped the session modules from firing by adding code to the Global.asax.
David