Ok, so after spending a good portion of a day debugging a stupid typing mistake inside a piece of code I am curious as to why the specific actions occured rather than an exception.
First of all the problem code.
Public Sub InstantiateIn(ByVal container As Control) Implements ITemplate.InstantiateIn
Dim hl As New HyperLink
AddHandler hl.DataBinding, AddressOf Me.BindData
container.Controls.Add(container)
End Sub
The obvious problem is that we are trying to add the container to itself, which I would have expected to cause an exception. However, instead it caused the page to prompt the user for their login credentials (Windows authentication in the browser).
Does anyone have an idea why this is the case, and why an exception or something else didn't happen?
EDIT
The reason for the question is that due to this mistake, the page is rendered useless, and prompts for Windows Login, and NOT giving stack overflow exceptions or any other exception.