Getting an URL from an Access db and turning into <a href> link
am 31.01.2008 02:42:29 von jeff
Hello,
I am trying to get a URL out of an Access database and make it a link on an
aspx web page. For some reason it looks like this on the page:
#http://mydomain.org#
I have the following AccessDataSource
DataFile="~/App_Data/mydata.mdb"
SelectCommand="SELECT * FROM [Events] WHERE ([ID] = ?) ORDER BY
[starttime]">
Type="Int32" />
Here is myFormView item template that contains:
DataSourceID="AccessDataSource1">
Description:
Text='<%# Bind("description") %>'>
Start Date:
Text='<%# Bind("starttime","{0:D}") %>'>
End Date:
Text='<%# Bind("endtime","{0:D}") %>'>
URL:
Location:
Text='<%# Bind("Location") %>'>
Image:
Do I have to get the value in some sort of script and then build my own
href> link? How can I parse off the # chars?
Thanks in advance!
Jeff
Re: Getting an URL from an Access db and turning into <a href> link
am 31.01.2008 06:48:11 von Nathan Sokalski
Just use the HyperLink control and do the same thing you did with all your
Label controls. Databinding can be used for most controls and properties,
and I know that it can be used for the NavigateUrl property of the HyperLink
control (I have done exactly that before, and I was also using Access). If
it is putting the value inside #'s like you said, doublecheck your syntax
and the value in the database. Your code for the Text properties of the
Labels looks correct, so if you do the same thing for the NavigateUrl
property of the HyperLink you should be good.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/
"JEFF" wrote in message
news:F1C795E1-F4B4-451E-B2BD-E84BB6389ADB@microsoft.com...
> Hello,
>
> I am trying to get a URL out of an Access database and make it a link on
> an aspx web page. For some reason it looks like this on the page:
>
> #http://mydomain.org#
>
> I have the following AccessDataSource
>
>
> DataFile="~/App_Data/mydata.mdb"
> SelectCommand="SELECT * FROM [Events] WHERE ([ID] = ?) ORDER BY
> [starttime]">
>
>
> Type="Int32" />
>
>
>
> Here is myFormView item template that contains:
>
>
> DataSourceID="AccessDataSource1">
>
>
> Description:
> Text='<%# Bind("description") %>'>
>
> Start Date:
> Text='<%# Bind("starttime","{0:D}") %>'>
> End Date:
> Text='<%# Bind("endtime","{0:D}") %>'>
> URL:
> Location:
> Text='<%# Bind("Location") %>'>
> Image:
>
>
>
> Do I have to get the value in some sort of script and then build my own
> href> link? How can I parse off the # chars?
>
> Thanks in advance!
> Jeff