I have a problem binding with LDAP (VS2005 ASP.NET 2.0 & vb)....!

Here is the code:

Public Function IsAuthenticated(ByVal domain As String, ByVal username As String, ByVal pwd As String) As Boolean

'-------------Path without user, password, auth anonymous -----------
Dim entry As DirectoryEntry = New DirectoryEntry("LDAP://ldap-test2/o=...............", "", "",


'Bind to the native AdsObject to force authentication
Dim obj As Object = entry.NativeObject

'Set the search with the user insered
Dim search As DirectorySearcher = New DirectorySearcher(entry)
Dim u As String = username
search.Filter = "(&(uid=" & u & ")

search.PropertiesToLoad.Add("uid") 'ID
search.PropertiesToLoad.Add("givenname") 'Name
search.PropertiesToLoad.Add("cn") 'Name and Surname
Dim result As SearchResult = search.FindOne()

If (result Is Nothing) Then
Return False
End If

'With the path I build the DN (with uid= or con cn=)
Dim IE As Integer = InStr(result.Path, "uid") + 3
Dim dn As String = "cn=" & Right(result.Path, result.Path.ToString.Length - IE)

'-------------------------- Try to bind with credentials -------------------
Dim ldap As System.DirectoryServices.Protocols.LdapConnection = New

ldap.SessionOptions.SecureSocketLayer = True
ldap.AuthType = AuthType.Basic
'Passo il dn dell' utente (es. uid/cn=luca, ou=ufficio, o=regione, dc=stato, dc=it)
Dim creds As New NetworkCredential(dn, pwd)
ldap.Bind(creds) '<----- it goes always on error giving me as message exception "Server LDAP non disponibile" (english: "Server LDAP is not available")
'I would like to debug until here to see if bind was been ok or not:-)
return Bind

Catch ex As System.DirectoryServices.Protocols.LdapException
MsgBox("Errore: " & ex.Message)
Return False
End Try

This is the code.
I try to connect in anonymous without username and password, to get the user and its path, but if I try to do the bind with credentials I get always the error "SERVER LDAP NON DISPONIBILE" (SERVER LDAP NOT AVAILABLE)
Seems that it is able to connect only in anonymous way....!

And this is my web.config:

<authentication mode="Forms">
<forms loginUrl="logon.aspx" name="adAuthCookie" timeout="60" path="/">
<deny users="?"/>
<allow users="*"/>
<identity impersonate="true"/>

What I wrong?

Thanks a lot!!