Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > .NET Framework 2.0
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
.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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 13th, 2008, 01:35 AM
Authorized User
 
Join Date: Aug 2008
Location: Dallas, Textas, USA.
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;
    }
Reply With Quote
  #2 (permalink)  
Old August 13th, 2008, 03:12 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
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 -/
Reply With Quote
  #3 (permalink)  
Old August 14th, 2008, 12:04 AM
Authorized User
 
Join Date: Aug 2008
Location: Dallas, Textas, USA.
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
Reply With Quote
  #4 (permalink)  
Old August 14th, 2008, 03:00 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
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 -/
Reply With Quote
  #5 (permalink)  
Old August 14th, 2008, 04:16 AM
Authorized User
 
Join Date: Aug 2008
Location: Dallas, Textas, USA.
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?
Reply With Quote
  #6 (permalink)  
Old August 14th, 2008, 04:31 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
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 -/
Reply With Quote
  #7 (permalink)  
Old August 14th, 2008, 04:43 AM
Authorized User
 
Join Date: Aug 2008
Location: Dallas, Textas, USA.
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 :(

Reply With Quote
  #8 (permalink)  
Old August 14th, 2008, 04:52 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
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 -/
Reply With Quote
  #9 (permalink)  
Old August 14th, 2008, 05:02 AM
Authorized User
 
Join Date: Aug 2008
Location: Dallas, Textas, USA.
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

Reply With Quote
  #10 (permalink)  
Old August 14th, 2008, 05:04 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

it....

/- Sam Judson : Wrox Technical Editor -/
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:08 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.