在回发Forbidden错误 [英] Forbidden error on postback

查看:115
本文介绍了在回发Forbidden错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在回传页面上出现我的应用程序会显示以下错误:

故宫:您没有权限访问/文件夹/在此服务器上teste.aspx

我可以正常访问的网页,当回传出现问题。例如,当一个的SelectedIndexChanged时,或者一个按钮被点击时,出现这种错误。但是,当导航由超发,不会发生错误。

只有当应用程序通过互联网访问出现此问题。匿名访问已启用。我使用IIS6和Windows Server 2003。


解决方案

这是一个权限问题。你需要做两件事情:1)更新您的项目来冒充的Web.config,和2)更新的文件夹权限,允许到你的机器上IUSR帐户读/写访问。下面是详细信息:

首先,在对System.Web节点添加到您的Web.config文件:

 <身份冒充=真/>


  1. 现在,去你的网站在Windows资源管理器的根文件夹,右键单击它,然后单击属性选项。


  2. 然后转到安全选项卡。点击编辑...按钮旁边,上面写着要更改权限,单击编辑文本。


  3. 您会看到组或用户名称列表。在其下方框中,单击添加...


  4. 在接下来的窗口中选择用户或组,点击左下角的高级按钮。


  5. 点击右侧的立即查找按钮。在搜索结果中,查找名为IUSR_计算机名(其中计算机名是您的计算机的名称)的帐户。左键单击它,选择它,然后单击确定


  6. 点击确定按钮上的选择用户或组窗口


  7. 在组或用户名列表中,找到您刚才添加的IUSR帐户,并确保在底部修改的箱子,读取/执行,列出文件夹内容,和读取都被选中为允许'。注意:您不必使用修改,但如果你有任何code写入到文件系统,你将需要检查


把那一个镜头。

有关信息的缘故,它为什么从本地主机的工作原理的原因,但并非遥不可及,是因为工作进程标识您作为身份验证的用户。上面的说明,迫使IIS使用Internet来宾帐户,然后您手动给需要该帐户的权限。

最后一个最后要注意的是,如果你仍然有问题,你可能想尝试给予相同的访问(使用上述步骤),以网络和网络服务帐户。我不认为他们没关系(我pretty确保他们的Vista,但我可能是错的),但以防万一。

My application displays the following error when a postback occurs on the page:

Forbidden: You do not have permission to access / folder / teste.aspx on this server.

I can access the pages normally, the problem is when a postback occurs. For example, when a selectedindexchanged occurs, or a button is clicked, this error appears. But, when navigation is made by hyperlinks, the error does not occur.

This problem only appears when the application is accessed over the internet. The anonymous access was already enabled. I am using IIS6 and windows server 2003.

解决方案

This is a permissions issue. You need to do two things: 1) update the Web.config of your project to impersonate, and 2) update the folder permissions to allow Read/Write access to the IUSR account on your machine. Here are the details:

First, Add this to your Web.config in the system.web node:

<identity impersonate="true"/>

  1. Now, go to the root folder of your Web site in Windows Explorer, right click it, and click the 'Properties' option.

  2. Then go to the Security tab. Click the 'Edit...' button next to the text that says 'To change permissions, click 'Edit.'

  3. You will see a list of Groups or user names. Underneath that box, click 'Add...'

  4. In the next window 'Select Users or Groups', click the 'Advanced' button on the bottom left.

  5. Click the 'Find Now' button on the right. In the search results, look for an account called IUSR_MachineName (where machine name is the name of your computer). Select it by left clicking it, and then click 'OK'

  6. Click 'OK' on the 'Select Users or Groups' window

  7. In the list of groups or usernames, locate the IUSR account that you just added, and make sure that at the bottom the boxes for Modify, Read/Execute, List Folder Contents, and Read are all checked as 'Allow'. Note: You don't have to use Modify, but if you have any code that writes to the file system, you will need that checked.

Give that a shot.

For information's sake, the reason why it works from localhost, but not remote, is because the worker process is identifying you as an authenticated user. The instructions above are forcing IIS to use the 'Internet Guest Account' and then you are manually giving the permissions needed to that account.

One last final note, is that if you still have a problem, you might want to try giving the same access (using the steps above) to the 'Network' and 'Network Service' accounts. I don't think they matter (I'm pretty sure they were for Vista, but I could be wrong), but just in case.

这篇关于在回发Forbidden错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆