 |
.NET Framework 2.0 For discussion of the Microsoft .NET Framework 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the .NET Framework 2.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

August 13th, 2008, 01:35 AM
|
Authorized User
|
|
Join Date: Aug 2008
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Problems with AJAX 2.0
I am facing a lot of problems with Ajax xmlhttp object.
1. specified
xmlHttpObj.open("POST","http://" + location.host + "App_Data/DataFile.xml", true);
it throws an unspecified error when i try debuggin using the debugger;
If i disable the javascript debugging in the browser it thorws 403 forbidden error.
I am using IE 7
Can anyone guide me here?
FYI
I dont know if the ActiveX objects are precent in my browser or not.
Can anyone tell me how to check without using following code for ActiveX objects?
function CreateXmlHttpRequestObject(){
if (window.ActiveXObject)
{
try
{
xmlHttpObj = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
xmlHttpObj = new ActiveXObject("Msxml2.XMLHTTP");
}
}
else
xmlHttpObj = new XMLHttpRequest();
return xmlHttpObj;
}
|

August 13th, 2008, 03:12 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
Are you not missing a "/":
xmlHttpObj.open("POST","http://" + location.host + "/App_Data/DataFile.xml", true);
If you are getting a 403 error this means you do not have permission - this usually means that anonymous access is turned off and the users current credentials aren't being sent automatically.
/- Sam Judson : Wrox Technical Editor -/
|

August 14th, 2008, 12:04 AM
|
Authorized User
|
|
Join Date: Aug 2008
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Yeah i was missing a slash there. HOw can we get the permission setting done?
However the other problems here are
1. xmlHttpObj.readyState is always 1 & never is set to 4
2. I dont get any value for responseText ir respon****ML
|

August 14th, 2008, 03:00 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
If you are using IIS then you set the permissions in IIS Manager on the security tab.
/- Sam Judson : Wrox Technical Editor -/
|

August 14th, 2008, 04:16 AM
|
Authorized User
|
|
Join Date: Aug 2008
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
insede the IIS i see only
Directory security. I tried playing around with this invain.
IIS --> Default Website --> XMLHTTPObject --> properties --> Directory Security
I'm i missing something here?
|

August 14th, 2008, 04:31 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
That's right - click on the Edit button next to "Authentication and Access Control" and make sure "Enable anonymous access" is ticked.
If that is ticked then the anonymous user does not have permissions on the files, in which case go in an set the security on the file in Windows Explorer.
/- Sam Judson : Wrox Technical Editor -/
|

August 14th, 2008, 04:43 AM
|
Authorized User
|
|
Join Date: Aug 2008
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i tried ticking this option with username and password set as well.
Also shared this website and enabled directory browsing.
Still doesnt work :(
|

August 14th, 2008, 04:52 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
If you're still getting the 403 error then its the windows security you need to fix - set it so Everyone has read access to the files.
I always try to test access to the directory in Firefox - if it prompts you for a username/password then you know anonymous access is borked, otherwise its usually windows security.
/- Sam Judson : Wrox Technical Editor -/
|

August 14th, 2008, 05:02 AM
|
Authorized User
|
|
Join Date: Aug 2008
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I tried in windows ... no luck
Other hint is .. when i try accessing the file directly by right clicking on the solution explorer --> view in browser, it
|

August 14th, 2008, 05:04 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
it....
/- Sam Judson : Wrox Technical Editor -/
|
|
 |