How to solve the HTTP Error 403-Forbidden error when using Visual Studio development server to develop a Domain Verification Program

Source: Internet
Author: User

The logon Page code is as follows:

Private void disablepagecaching () <br/>{< br/> response. expires = 0; <br/> response. cache. setnostore (); <br/> response. appendheader ("Pragma", "No-Cache"); <br/>}</P> <p> protected void page_load (Object sender, eventargs E) <br/>{< br/> disablepagecaching (); <br/> If (this. request. cookies [globalparameters. cookie_key_logonuserflag]! = NULL & this. request. cookies [globalparameters. cookie_key_logonuserflag]. value. tostring () = "1") <br/>{< br/> If (httpcontext. current. user. identity. isauthenticated) <br/>{< br/> response. cookies [globalparameters. cookie_key_logonuserflag]. value = "0"; <br/> response. redirect ("~ /Default. aspx ", true); <br/>}</P> <p> protected void btnlogon_click (Object sender, eventargs E) <br/> {<br/> response. cookies [globalparameters. cookie_key_logonuserflag]. value = "1"; <br/> session [globalparameters. session_key_logonuser] = NULL; <br/> response. statuscode = 401; <br/> response. statusdescription = "unauthorized"; <br/> response. addheader ("www-authenticate", "negotiate"); <br/> response. addheader ("www-authenticate", "NTLM"); <br/>}

 

If you use Visual Studio development server instead of creating a virtual directory in IIS, an error occurs.

Version Information:ASP. NET development server 9.0.0.0

 

In addition, when a breakpoint is set during debugging, after the domain user input box is displayed and the user and password are entered, page load is not triggered for the dead and dead, which is the above error.

The solution is to create a virtual directory.

Server Error in '/'application.

HTTP Error 403-forbidden.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.