Hello.
I ran into the following issue when trying to run a test website on IIS 7.5 (Windows Server 2008 R2 DatacenterEdition).
The web-app is configured to run with framework version 3.5 in a .Net 2.0 app pool. Also the framework 4.0 beta 2 is
installed on the server.
The application named 'TestPfade' is located under the website's root named 'Default'. It is not only a virtual directory but defined as an application.
The folder structure looks like this:
When viewed in a browser the image gets shown because the given relative path is correctly resolved to 'images/Lighthouse.jpg' but the paths to the ajax-framework resources also include the application's root folder and therefor aren't found: 'src="/TestPfade/WebResource.axd?d=1bX...' !
Hi, what do you mean not found? Does the intellisense say it's not found or are you getting any errors in the browser? You can easily test this by attempting to call a javascript function that is contained in functions.js and see if it's called. Alternatively
you could load up firebug in firefox and under the script tab, check to see if functions.js is downloaded.
Hi, what do you mean not found? Does the intellisense say it's not found or are you getting any errors in the browser? You can easily test this by attempting to call a javascript function that is contained in functions.js and see if it's called. Alternatively
you could load up firebug in firefox and under the script tab, check to see if functions.js is downloaded.
I'm getting js-errors in the browser. First of all 'Sys is undefined' what shows that not even the 'internal' ScriptManager- js-libraries could be loaded.
And if I take a look at the html-source this is, IMO, obvious because the paths to the WebResource.axd and ScriptResource.axd are 'corrupted' by prefixing them with
the application's root folder. I can even remove the ScriptReference to functions.js and I'm still getting 'Sys is undefined'.
Try creating an Ajax enabled website project and see if the problem goes away. On what .net version was the application developed under and were ajax extensions 1.0 used?
You may need to update your web config if it's an older app.
Also the scriptmanager should be the topmost control after the form tag.
Hello.
It's actually an almost blank test solution. But I found out that it seems to be somehow linked with the redirection configured in our
ISA-Server. When I test the site in this way 'http://myserver/testpfade/default.aspx' everything works as expected. But if I address it
via the subdomain configured in our ISA - 'http://testpfade.mydomain.de' - the described errors occur. This leaves me clueless :(
But it confuses me that the paths to the dynamic resources like WebResource.axd still include my application directory: '/TestPfade/WebResource.axd' ?
It seems like still the Website-root is seen as the application and not 'TestPfade' ...
Thanks for the links.
But unfortunately they didn't help. Sorry if I was too unclear in te previous posts.
Actually the script handler works. The problem is that everything only works together
when the website is addressed by its network internal address. If its addressed from
te outside world through our ISA-Server, whih maps the app's name as a subdomain
to the 'real' app, it doesn't work any more because the dynamic resouce paths don't
fit any more.
Example:
Unfortunately te ScriptManager injects src="myapp/webresource.axd?..." into the page so that the
404 occurs wich leads to 'Sys is undefined' when I call the page via the public url.
that's exactly the phenomenon we are experiencing. Unfortunately we weren't able to solve it yet.
It would be great if you would post here again if you found a solution to this, I will do the same.
Best Regards
mrhoga
0 Points
5 Posts
ScriptManager uses Website-root instead of Application root directory
Jan 27, 2010 02:41 PM|LINK
Hello.
I ran into the following issue when trying to run a test website on IIS 7.5 (Windows Server 2008 R2 DatacenterEdition).
The web-app is configured to run with framework version 3.5 in a .Net 2.0 app pool. Also the framework 4.0 beta 2 is
installed on the server.
The application named 'TestPfade' is located under the website's root named 'Default'. It is not only a virtual directory but defined as an application.
The folder structure looks like this:
The markup of the sole document reads as follows:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestPfade._Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Image ID="Image1" runat="server" ImageUrl="~/images/Lighthouse.jpg" /> </div> <asp:ScriptManager ID="DefaultMasterScriptManager" runat="server" ScriptMode="Debug"> <CompositeScript> <Scripts> <asp:ScriptReference Path="~/Scripts/Functions.js" ScriptMode="Debug" /> </Scripts> </CompositeScript> </asp:ScriptManager> </form> </body> </html>When viewed in a browser the image gets shown because the given relative path is correctly resolved to 'images/Lighthouse.jpg'
but the paths to the ajax-framework resources also include the application's root folder and therefor aren't found: 'src="/TestPfade/WebResource.axd?d=1bX...' !
Here is the complete html-source generated:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head><title> </title></head> <body> <form name="form1" method="post" action="default.aspx" id="form1"> <div> <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /> <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNzQ4MjkzNzA2ZGS40NGtMnD44GbrC4tTUAYXMH78SQ==" /> </div> <script type="text/javascript"> //<![CDATA[ var theForm = document.forms['form1']; if (!theForm) { theForm = document.form1; } function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } //]]> </script> <script src="/TestPfade/WebResource.axd?d=1bX-XGREg8l49ZALBuiZww2&t=633802704069218315" type="text/javascript"></script> <script src="/TestPfade/ScriptResource.axd?d=BSwr1FKvqWpkLLmwrmw51deNtxk8ym8u0vUZS-LtuEIX2r37ER0JP5jilX89toNkuSMnowTl6j_qjYk0_8Mdd6rXwLa9n5Z8RaA8gTz1gkM1&t=ffffffffec2d9970" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ if (typeof(Sys) === 'undefined') throw new Error('Fehler beim Laden des clientseitigen ASP.NET Ajax-Frameworks.'); //]]> </script> <script src="/TestPfade/ScriptResource.axd?d=BSwr1FKvqWpkLLmwrmw51deNtxk8ym8u0vUZS-LtuEIX2r37ER0JP5jilX89toNk6r_pcvFuGC8AsXLqGD1F3hiKkxoG9R-EQgU5fG6OCK4yV84MiCCeoV0qNIjMmHBG0&t=ffffffffec2d9970" type="text/javascript"></script> <script src="/TestPfade/ScriptResource.axd?d=B_-AWCzg_8HPQBhgNcTQzFyOKJ75GYxYHm-7KPaT-PpWwrL-aqGJCgy2napNYMQe0" type="text/javascript"></script> <div> <img id="Image1" src="images/Lighthouse.jpg" style="border-width:0px;" /> </div> <script type="text/javascript"> //<![CDATA[ Sys.WebForms.PageRequestManager._initialize('DefaultMasterScriptManager', document.getElementById('form1')); Sys.WebForms.PageRequestManager.getInstance()._updateControls([], [], [], 90); //]]> </script> <script type="text/javascript"> //<![CDATA[ Sys.Application.initialize(); //]]> </script> </form> </body> </html>Does anybody know what's going on here?
Many thanks for your help in advance and best regards
Holger
scriptmanager asp.net relative source
lb514
Member
343 Points
74 Posts
Re: ScriptManager uses Website-root instead of Application root directory
Jan 27, 2010 04:06 PM|LINK
Hi, what do you mean not found? Does the intellisense say it's not found or are you getting any errors in the browser? You can easily test this by attempting to call a javascript function that is contained in functions.js and see if it's called. Alternatively you could load up firebug in firefox and under the script tab, check to see if functions.js is downloaded.
mrhoga
0 Points
5 Posts
Re: ScriptManager uses Website-root instead of Application root directory
Jan 27, 2010 04:54 PM|LINK
I'm getting js-errors in the browser. First of all 'Sys is undefined' what shows that not even the 'internal' ScriptManager- js-libraries could be loaded.
And if I take a look at the html-source this is, IMO, obvious because the paths to the WebResource.axd and ScriptResource.axd are 'corrupted' by prefixing them with
the application's root folder. I can even remove the ScriptReference to functions.js and I'm still getting 'Sys is undefined'.
lb514
Member
343 Points
74 Posts
Re: ScriptManager uses Website-root instead of Application root directory
Jan 27, 2010 05:12 PM|LINK
Try creating an Ajax enabled website project and see if the problem goes away. On what .net version was the application developed under and were ajax extensions 1.0 used?
You may need to update your web config if it's an older app.
Also the scriptmanager should be the topmost control after the form tag.
mrhoga
0 Points
5 Posts
Re: ScriptManager uses Website-root instead of Application root directory
Jan 27, 2010 05:47 PM|LINK
Hello.
It's actually an almost blank test solution. But I found out that it seems to be somehow linked with the redirection configured in our
ISA-Server. When I test the site in this way 'http://myserver/testpfade/default.aspx' everything works as expected. But if I address it
via the subdomain configured in our ISA - 'http://testpfade.mydomain.de' - the described errors occur. This leaves me clueless :(
But it confuses me that the paths to the dynamic resources like WebResource.axd still include my application directory: '/TestPfade/WebResource.axd' ?
It seems like still the Website-root is seen as the application and not 'TestPfade' ...
lb514
Member
343 Points
74 Posts
Re: ScriptManager uses Website-root instead of Application root directory
Jan 27, 2010 08:26 PM|LINK
http://weblogs.asp.net/chrisri/archive/2007/02/02/demystifying-sys-is-undefined.aspx
http://geekswithblogs.net/lorint/archive/2007/03/28/110161.aspx
Does these links help at all?
mrhoga
0 Points
5 Posts
Re: ScriptManager uses Website-root instead of Application root directory
Jan 28, 2010 10:39 PM|LINK
Thanks for the links.
But unfortunately they didn't help. Sorry if I was too unclear in te previous posts.
Actually the script handler works. The problem is that everything only works together
when the website is addressed by its network internal address. If its addressed from
te outside world through our ISA-Server, whih maps the app's name as a subdomain
to the 'real' app, it doesn't work any more because the dynamic resouce paths don't
fit any more.
Example:
Addressed internal:
http://myinternalservername/myapp/default.aspx -> everything's fine
also
http://myinternalservername/myapp/default.aspx/myapp/webresource.axd?... -> fine, I get the the scripts as expected.
Addressed from the outside world:
http://myapp.mydomain.com/default.aspx -> Sys is undefined
Also: http://myapp.mydomain.com/myapp/webresource.axd?... -> 404
But adressing it with: http://myapp.mydomain.com/webresource.axd?... -> fine, I get the the scripts as expected.
Unfortunately te ScriptManager injects src="myapp/webresource.axd?..." into the page so that the
404 occurs wich leads to 'Sys is undefined' when I call the page via the public url.
Actually it seems a bit like a misconfiguration of our ISA-Server which maps the the url http://myapp.mydomain.com
to http://myinternalservername/myapp/ but we're really gut stuck with this :(
lb514
Member
343 Points
74 Posts
Re: ScriptManager uses Website-root instead of Application root directory
Jan 28, 2010 11:14 PM|LINK
Well I'm going to let someone else answer this. Sorry.
I've never dealt with an ISA server so I'd be better off not confusing the subject anymore and or guessing as to what's wrong.
jimslim
Member
2 Points
1 Post
Re: ScriptManager uses Website-root instead of Application root directory
Feb 19, 2010 08:41 AM|LINK
mrhoga, do you solved your Problem?
I have the same Problem when publishing my AJAX enabled site through an ISA 2006 web publishing rule.
https://internal/default.aspx - everything is fine
https://subdomain.externaldomain.com/default.aspx - I get an sys is undefined error
Thanks in advance.
mrhoga
0 Points
5 Posts
Re: ScriptManager uses Website-root instead of Application root directory
Feb 22, 2010 09:36 AM|LINK
Hello jimslim,
that's exactly the phenomenon we are experiencing. Unfortunately we weren't able to solve it yet.
It would be great if you would post here again if you found a solution to this, I will do the same.
Best Regards
Holger