将站点更改为匿名访问会导致 jQuery 小问题

发布于 2024-09-15 07:43:44 字数 443 浏览 2 评论 0原文

我有一个简单的 ASP.Net 3.5 站点,本质上是主/细节类型。母版页显示数据库记录的 GridView,单击给定行的“编辑”将显示带有详细信息视图的编辑表单。相当标准的东西。现在,我在 UpdatePanel 中有 GridView,并使用 jQuery FancyBox 启动编辑表单。保存编辑的记录后,子页面会更新父页面,并短暂突出显示编辑的行。很多 AJAXy 的优点,而且一切都很完美……

除非我在 IIS 中取消选中该站点的“匿名访问”。然后,jQuery 部分变得有点古怪和不可预测。也就是说,行突出显示在大多数情况下停止工作。如果我返回并重新启用匿名访问,一切都会正常。

我关闭了匿名访问,因为我想让网站根据 Windows 登录信息了解用户是谁。我发现这个设置会破坏 jQuery 的东西很奇怪,所以我可能只是没有掌握一些基本概念。我很想听听其他人遇到过这个问题(并希望能够克服它!)。

谢谢, 克里斯

I have a simple ASP.Net 3.5 site that is essentially of the master/detail variety. A master page shows a GridView of database records, and clicking on Edit for a given row brings up an edit form with a DetailsView. Pretty standard stuff. Now, I have the GridView in an UpdatePanel, and launch the edit form with a jQuery FancyBox. After saving the edited record, the child page updates the parent, and briefly highlights the edited row. Lots of AJAXy goodness, and it all works perfectly...

... except when I uncheck "Anonymous access" for the site in IIS. Then, the jQuery part gets a bit squirrelly and unpredictable. Namely, the row highlighting stops working most of the time. If I go back and re-enable Anonymous access, it all works fine.

I turned off Anonymous access since I'd like to have the site know who the user is based on their Windows login. I find it quite odd that this setting would break jQuery stuff, so I'm probably just not grasping some elementary concept. Would love to hear of anyone else who has had this problem (and hopefully overcome it!).

Thanks,
Chris

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不知所踪 2024-09-22 07:43:44

您用于测试站点的非匿名用户帐户实际上是否具有文件系统级别站点上所有文件的读取权限?这很重要 - 如果 ACL 不一致,那么您可能会遇到这样的情况:您的浏览器成功地为您提供了网站中的部分内容(或者来自您的浏览器缓存,您可能没有清除),但其他内容部分遇到 HTTP 403 Forbidden 错误。在 Ajax 环境中,此类故障可能会悄无声息地发生。

确保您使用 Firefox 上的 Firebug 或 Chrome 的开发人员工具来查看您发出的请求以及获得的结果。仔细观察那些 403——这肯定是有麻烦的迹象。

Does the non-Anonymous user account you're using to test the site actually have read access to all the files on the site at the file-system level? This is important -- if ACLs are not consistent, then you may be running into a situation where your browser serves you part of the content from web site successfully (or from your browser cache, which you probably didn't clear), but other parts hit up against an HTTP 403 Forbidden error. These sorts of failures may happen silently in an Ajax environment.

Make sure you're using something like Firebug on Firefox or Chrome's developer tools to see what requests you're making, and the results you're getting. Watch carefully for those 403s -- that's surely a sign of trouble.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文