Wrox Programmer Forums
|
.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
 
Old August 13th, 2008, 01:35 AM
Authorized User
 
Join Date: Aug 2008
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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;
    }
 
Old August 13th, 2008, 03:12 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

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 -/
 
Old August 14th, 2008, 12:04 AM
Authorized User
 
Join Date: Aug 2008
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
 
Old August 14th, 2008, 03:00 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

If you are using IIS then you set the permissions in IIS Manager on the security tab.

/- Sam Judson : Wrox Technical Editor -/
 
Old August 14th, 2008, 04:16 AM
Authorized User
 
Join Date: Aug 2008
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?
 
Old August 14th, 2008, 04:31 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

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 -/
 
Old August 14th, 2008, 04:43 AM
Authorized User
 
Join Date: Aug 2008
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i tried ticking this option with username and password set as well.

Also shared this website and enabled directory browsing.

Still doesnt work :(

 
Old August 14th, 2008, 04:52 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

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 -/
 
Old August 14th, 2008, 05:02 AM
Authorized User
 
Join Date: Aug 2008
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old August 14th, 2008, 05:04 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

it....

/- Sam Judson : Wrox Technical Editor -/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding AJAX to CSK2 - Problems dgrieser BOOK: Beginning ASP.NET 2.0 AJAX ISBN: 978-0-470-11283-0 0 July 29th, 2008 12:37 PM
Ajax Problems ch. 27 gigs BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 0 September 24th, 2007 05:50 AM
Recommend an AJAX IDE - JoyiStar AJAX WebShop. kingstar Ajax 4 December 15th, 2006 05:12 AM
new Ajax article: Creating an Ajax Search Widget jminatel Ajax 0 May 11th, 2006 02:50 PM
Problems with AJAX Function hugh@kmcnetwork.com Javascript 4 December 14th, 2005 12:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.