S
stewart
Hi,
I have a login page, users enter a name and password. The name and password
they enter are checked against an active directory. If they enter the
correct credentials then then are logged in and redirected to the
applications start page. If however they enter invalid credentials they
remain on the login page and an error message is displayed.
The error message is displayed ok but the progress bar in the browser
windows is only partially completed and takes about another 5 mins to
finish, but all the content is rendered, except anything I do in a
response.write.
So it appears that the repsonse is not ending, this only happens when the
login fails and an exception is thrown by the
system.directoryservices.directoryentry that I'm using.
I have a simple function that returns a boolean when checking a users
credentials. This is running on .net v1.1.4322. I have exactly the same
code on a different app thats runs on .net v2.0, it does not have this
problem. Interestingly, if I turn tracing on the problem dissappears and
the response ends correctly.
Heres the code I use:
Try
entry = New DirectoryEntry("LDAP://" + adsPath, user, password,
AuthenticationTypes.Secure)
Dim mySearcher As DirectorySearcher
Dim obj As Object = entry.NativeObject
mySearcher = New DirectorySearcher(entry)
mySearcher.Filter = "(sAMAccountName=" + user + ")"
mySearcher.PropertiesToLoad.Add("cn")
Dim res As SearchResult = mySearcher.FindOne()
If res Is Nothing Then Return False
Return True
Catch ex As Exception
entry.Close()
Return False
End Try
Any help would be greatly appreciated, as I'm at a loss as how to resolve
this.
I have a login page, users enter a name and password. The name and password
they enter are checked against an active directory. If they enter the
correct credentials then then are logged in and redirected to the
applications start page. If however they enter invalid credentials they
remain on the login page and an error message is displayed.
The error message is displayed ok but the progress bar in the browser
windows is only partially completed and takes about another 5 mins to
finish, but all the content is rendered, except anything I do in a
response.write.
So it appears that the repsonse is not ending, this only happens when the
login fails and an exception is thrown by the
system.directoryservices.directoryentry that I'm using.
I have a simple function that returns a boolean when checking a users
credentials. This is running on .net v1.1.4322. I have exactly the same
code on a different app thats runs on .net v2.0, it does not have this
problem. Interestingly, if I turn tracing on the problem dissappears and
the response ends correctly.
Heres the code I use:
Try
entry = New DirectoryEntry("LDAP://" + adsPath, user, password,
AuthenticationTypes.Secure)
Dim mySearcher As DirectorySearcher
Dim obj As Object = entry.NativeObject
mySearcher = New DirectorySearcher(entry)
mySearcher.Filter = "(sAMAccountName=" + user + ")"
mySearcher.PropertiesToLoad.Add("cn")
Dim res As SearchResult = mySearcher.FindOne()
If res Is Nothing Then Return False
Return True
Catch ex As Exception
entry.Close()
Return False
End Try
Any help would be greatly appreciated, as I'm at a loss as how to resolve
this.