N
NBB
I can't figure this one out. Here's the situation, should be pretty
for the pros in here.
I have a ListBox that is populated with the DataTextField and
DataValueField flags of the DataSet. Everything populates just fine
and works great.
The DataTextField displays text from a database column called Path,
which is the absolute URL of a file. What I would like it to display
is just the filename, essentially trimming off everything previous to
(and including) the last forward slash character of the URL. I've come
up with this:
Right(thepath, (Len(thepath) - (thepath.LastIndexOf("/")+1)))
Where "thepath" is a string representing the absolute URL. It works
great when I manually define thepath as a string. But I don't have
any idea how to implement this on the the values coming out of the
database's Path column.
I've been playing with the OnDataBinding and OnPreRender events for 2
days, but, alas, can't get them to work with the output of the
DataTextField.
Could someone shed some light on the matter? I doesn't seem like it
should be that hard to use a replace function or something like my
masking technique on the output, but I'm stumped.
Thanks for any help you can provide!
By the way, that's no longer my email address, so don't send to it.
I'll have to update my Google profile later today.
for the pros in here.
I have a ListBox that is populated with the DataTextField and
DataValueField flags of the DataSet. Everything populates just fine
and works great.
The DataTextField displays text from a database column called Path,
which is the absolute URL of a file. What I would like it to display
is just the filename, essentially trimming off everything previous to
(and including) the last forward slash character of the URL. I've come
up with this:
Right(thepath, (Len(thepath) - (thepath.LastIndexOf("/")+1)))
Where "thepath" is a string representing the absolute URL. It works
great when I manually define thepath as a string. But I don't have
any idea how to implement this on the the values coming out of the
database's Path column.
I've been playing with the OnDataBinding and OnPreRender events for 2
days, but, alas, can't get them to work with the output of the
DataTextField.
Could someone shed some light on the matter? I doesn't seem like it
should be that hard to use a replace function or something like my
masking technique on the output, but I'm stumped.
Thanks for any help you can provide!
By the way, that's no longer my email address, so don't send to it.
I'll have to update my Google profile later today.