473,587 Members | 2,607 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why can't I do this????

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>
Nov 19 '05 #1
3 1363
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>

Nov 19 '05 #2
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>

Nov 19 '05 #3
Regardless of datasource, you still can't do the databind (<%#...%>) in a
hyperlinkcolumn . DataNavigateUrl Field needs the name of a public property of
the dataitem. I don't do much with AD, but in your case looks like each
dataitem is of type SearchResult, so DataNavigateUrl Field should be a
property of that, e.g. "FileName", etc., and the framework will use
reflection to go get that value.

Also, this is among the reasons I gravitate toward the code-behind and
ItemDataBound--getting this straight in the html w/out intellisense, etc. is
pretty tedious.

Have fun.

Bill

"Tim::.." wrote:
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>

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2827
by: AK | last post by:
Hi all, I have a form which simulates a form collecting a person's info for a job. The form has the field's like fname, lname, address etc. The last field in the form is browse for resume and upload it. What I did until now is, I am inserting all the data other than the resume into a table and storing the resumes in a seperate directory. My...
1
3675
by: farzad | last post by:
Hi I try to install php_ming.so in my php . I am using Redhat 8.0 php 4.2.2 apache 2.0.4. I am doing as the howto install file want me to do. as follow. http://ming.sourceforge.net/install.html ------------------ download php_ming.so.gz uncompress it and copy it to your php modules directory
1
3141
by: Randell D. | last post by:
Folks, I use Apache/PHP with Webazlier to view the log files. I get a number of user agents (web browsers?) that visit the website - For example: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1 Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90) Mozilla/2.0 (compatible; T-H-U-N-D-E-R-S-T-O-N-E) Googlebot/2.1...
2
2138
by: Alex | last post by:
Is it more time-consuming to troubleshoot or just start from scratch. PHP used to work that's why I'm tempted to just re-install Linux.
0
1966
by: @(none).dk | last post by:
Hi I am not sure whether my new webhotel has setup "AddType jad/jar files" in the apache configuration file. The webhotel has php - so my question is: Can I make something with php that ensures that my homepage can provide jad/jar files to e.g. mobile phones? (the mobile phones expect that the files begins with something like...
3
4224
by: lawrence | last post by:
I do get that MD5() scrambles a password, but how do you then unscrable it? I want to get $password from the user, scrable it, then append it to every link.
8
2496
by: Jeffrey Silverman | last post by:
'nuff said. Just venting... -- Jeffrey D. Silverman | jeffrey AT jhu DOT edu Johns Hopkins University | Baltimore, MD Website | http://www.wse.jhu.edu/newtnotes/
5
2752
by: paul13 | last post by:
This seems weird, but when I use the following code, include 'http://www.foo.com/includes.php'; includedfunction(); I am told that it is a call to an undefined function, but 'includedfunction' is on the server. the following includes work fine, and the run the called function with
2
30235
by: tobias | last post by:
I am new in programming with PHP. I wrote the following code: file name: output.php <?php echo $texto; ?> And I call it on my browser like: http://localhost/cgt/output.php?texto=testing
3
4036
by: lawrence | last post by:
I haven't been able to reach www.php.net for days. Most of the rest of the web is working for me, though I've bad trouble reaching any English sites. Anyone else having trouble?
0
7918
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8206
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5713
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.