Thanks Bill,
I have no problem when my datasource is a database or something similar it
is just when I use DirectoryServic es
For some reason I cant get it to work...
Here is my databind!
Would really appritiate any help anyone can provide!
Thanks
...CODE
Sub GetUserADInfo()
Dim strUserName As String
Dim strADPath As String
strUserName = "netadmin" 'HttpContext.Cu rrent.User.Iden tity.Name
strADPath = "netdomain.usem bassy.dk"
Dim Entry As DirectoryEntry = New DirectoryEntry( "LDAP://" &
strADPath, "netadmin", "N3753rv3r0 !")
' Create a DirectorySearch er object.
Dim mySearcher As New DirectorySearch er(Entry)
' Use the FindOne method to find the object, which in this case, is
the user
' indicated by User Name and assign it to a SearchResult.
mySearcher.Filt er = ("(&(objectCate gory=person)(ob jectClass=user) )")
'Dim MySearchResult As SearchResult = mySearcher.Find One
Dim results As SearchResultCol lection
results = mySearcher.Find All()
dgADUserInfo.Da taSource = results
dgADUserInfo.Da taBind()
End Sub
"Bill Borg" wrote:
Tim, the "canned" columns like hyperlinkcolumn and boundcolumn don't get
databound themselves. Instead, you specify just the field names from the
datasource on the datagrid. So, for DataNavigateUrl Field just enter the field
name that corresponds to the {0} in your format string.
e.g. from the docs...
<Columns>
<asp:HyperLinkC olumn
HeaderText="Sel ect an Item"
DataNavigateUrl Field="IntegerV alue"
DataNavigateUrl FormatString="d etailspage.aspx ?id={0}"
DataTextField=" PriceValue"
DataTextFormatS tring="{0:c}"
Target="_blank"/>
</Columns>
Or, skip the hyperlinkcolumn , create your own itemtemplate, and add your own
asp:hyperlink that you can databind to (I find this way easier and more
flexible than the canned choices).
Bill
"Tim::.." wrote:
I keep getting the following error when trying to do the following!
'DataBinding' is not an event of 'System.Web.UI. WebControls.Hyp erLinkColumn'.
How do I get the value Name into the DataNavigateURL Field??? I would really
appritiate any advice! Thanks
<asp:hyperlinkc olumn
DataNavigateUrl Field='<%#Repla ce(Container.Da taItem.GetDirec toryEntry().Nam e,"CN=","")%> '
DataNavigateUrl FormatString="u srManDetails.as px?id={0}" Text="<img border=0
src=../images/edit.gif alt=Edit Page>">
<ItemStyle HorizontalAlign ="Center"></ItemStyle>
</asp:hyperlinkco lumn>