Showing posts with label ajax. Show all posts
Showing posts with label ajax. Show all posts

Thursday, March 22, 2012

The file [filename] has not been pre-compiled, and cannot be requested.

I hvae develop a web site. and in this i have use ajax beta2 release it work fine on server but when i upgrade Asp.net Ajax 1.0 with january release. it work fine on my system but when i hvae compile the project and upload this on server then it give me the following error.

The file [filename] has not been pre-compiled, and cannot be requested.

how can i have solve this problem. help me

Hi, amritpal

You can turn this question into asp.net ajax forums for a try. Good luck!

The file has not been pre-compiled, and cannot be requested exception

I have a production application that uses ASP .NET 2.0 (C#) and AJAX 1.0 RC which dynamically assembles a page and displays content. I installed AJAX 1.0 RC (the corrected build which allows pre-compiled website to be published) on my production server and deployed my application (AJAX controls used in my app are UpdatePanel and Timer controls). The site was working fine for 3 days and then suddenly I started getting request timed-out. I just changed the timer refresh settings from 7 seconds to 10 seconds in my web.config and the app started working fine (may be because the change in web.config recompiled the app). Again after a couple of days I was getting request timed-out. I thought AJAX was the culprit and removed that functionality from my app and re-deployed it on production. I did not remove the AJAX references in web.config.

Even after removing the AJAX piece from my code I was getting request timed-out error again after 2-3 days. Then I thought that there was some footprint of AJAX left in my app and hence I uninstalled the AJAX 1.0 RC from my production server and also removed the following section from web.config -

<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

Everything seemed to be working fine for 24 hours when suddenly my site was completely down. I was getting the error -

The file '/Default.aspx' has not been pre-compiled, and cannot be requested.
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

I checked out lots of blogs and forums to find out what caused this error and some of them mentioned that the application was referring to some dlls that were not present. When I took a closer look at my web.config, I saw a few more references to AJAX left out -

<pages enableEventValidation="false" enableViewStateMac="false" viewStateEncryptionMode="Never">
<controls>
<add namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
<add namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
</controls>
</pages>

<buildProviders>
<add extension=".asbx" type="Microsoft.Web.Services.BridgeBuildProvider"/>
</buildProviders>

<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>

I just went ahead and deleted all these lines from my web.config and now my app seems to be running fine without issues. But I'm not sure if this really fixed all my issues or if its just a temporarily cure. What is the guarantee that the problem will not resurface? Have I removed the right extensions from my web.config? There are no other 3rd party controls that I'm using on my application. I would appreciate if someone could shed some light on what the real error is when I get "The file has not been pre-compiled, and cannot be requested" and how to make sure that it does not happen again... Thanks in advance...

Hi, mramani

It seems difficulty for solve. This reference may be helpful to you:

http://forums.asp.net/thread/1336283.aspx

Hope this helpful.

Tuesday, March 13, 2012

the j in ajax: run javascript method on async postack

hey all,
is there a way to run my javascript method on every async postback?

thanks,
rodcharIts not a "postback", its a callback, and that is where your javascript
callback function is specified, depending on what AJAX framework you are
running.
For example, a typical JSON structure returned from an "AJAX" call would
actually invoke your javascript function by itself, passing in the JSON data
as an argument.

Regarding the "j" in AJAX, that's actually the ONLY letter in the acronym
that makes any sense:

A - asynchronous: not all Remote Scripting calls are async.
J - javascript: yes - all Remote Scripting involves Javascript.
X - Xml: Just about nobody uses XML anymore with AJAX.

I liked it better when it was just called "Remote Scripting". That was 1998.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
"rodchar" wrote:

Quote:

Originally Posted by

hey all,
is there a way to run my javascript method on every async postback?
>
thanks,
rodchar


see the Sys.WebForms.PageRequestManager, it has an endRequest event you
can attach your javascript to.

-- bruce (sqlwork.com)

rodchar wrote:

Quote:

Originally Posted by

hey all,
is there a way to run my javascript method on every async postback?
>
thanks,
rodchar


Howdy,

From top of my head:

<script type="text/javascript">

var requestManager = Sys.WebForms.PageRequestManager.getInstance();

requestManager.add_initializeRequest(IntializeRequ estHandler);
requestManager.add_endRequest(EndRequestHandler);

function IntializeRequestHandler(sender, args)
{
// this function will be called
// before async request is executed

// do soemthing here
}

function EndRequestHandler(sender, args)
{
// this function will be called
// after async request is completed

// do soemthing here
}

</script>

Hope it helps
--
Milosz

"rodchar" wrote:

Quote:

Originally Posted by

hey all,
is there a way to run my javascript method on every async postback?
>
thanks,
rodchar


thanks everyone for the help and clarification.
rod.

"rodchar" wrote:

Quote:

Originally Posted by

hey all,
is there a way to run my javascript method on every async postback?
>
thanks,
rodchar