Ocean10000

msg:4232234 | 4:24 am on Nov 19, 2010 (gmt 0) |
I beleive the hyperlink field you are talking about is treated as a string value via data access objects, and would come out as a simple plain text. You will have to just create the hyperlink in the Asp.net code using this plain string in the href value. Example without data binding to keep it easy to read where "value" is the hyperlink text from the database <a href="<%=value%>"><%=value%></a>
|
Color7

msg:4232456 | 6:08 pm on Nov 19, 2010 (gmt 0) |
Hi Ocean1000, I'm new to .Net, so I apologize in advance for any ignortant questions. :) Here is what my code looks like so far:
<asp:DataList id="DataList1" runat="server" CellPadding="4" DataSourceID="AccessDataSource1" ForeColor="#333333" RepeatColumns="1"> <AlternatingItemStyle BackColor="White" /> <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /> <ItemStyle BackColor="#E3EAEB" /> <ItemTemplate> <asp:Label id="LogosLabel" runat="server" Text='<%# Eval("Logos") %>' /> <asp:Label id="DownloadLabel" runat="server" Text='<%# <a href="<%=Download%>"<%=Download%></a> %' /> <br /> <br /> </ItemTemplate> <SelectedItemStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" /> </asp:DataList> <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="Marketing-Files.mdb" SelectCommand="SELECT [Logos], [Download] FROM [Logos]"> </asp:AccessDataSource> This Produces a column with 1 field and a column with =% So, it looks like this: Logo 1 =% The desired result would be: Logo 1 DOWNLOAD (where DOWNLOAD is a hyperlink) Thanks for your help!
|
Ocean10000

msg:4232467 | 6:38 pm on Nov 19, 2010 (gmt 0) |
I think this is what you are trying to achieve. <ItemTemplate> <asp:Image runat="server" ImageUrl='<%# Eval("Logos") %>' /> <asp:HyperLink runat="server" NavigateUrl='<%# Eval("Download", "{0}") %>' Text='Download'></asp:HyperLink> <br /> <br /> </ItemTemplate>
|
Color7

msg:4232478 | 6:55 pm on Nov 19, 2010 (gmt 0) |
I think we're getting closer. The code above includes an image. I'd just like to pull text from my db in that column. ie. Logo 1 (followed by the download link.) The hyperlink is pointing here: Download%20Now#http://Download%20Now# How do I define the link from the db? Thanks!
|
Color7

msg:4232555 | 9:57 pm on Nov 19, 2010 (gmt 0) |
ok, I noticed I had an error in my Access db that was causing the URL to display incorrectly. After fixing the error, I'm now getting a double URL. ie: \\MyServer\Files\Subfolder\downloads\Logos\MyLogo.ai#//MyServer/Files/Subfolder/downloads/Logos/MyLogo.ai#
|
Color7

msg:4232558 | 10:08 pm on Nov 19, 2010 (gmt 0) |
And to fix the image issue described above I just replaced the image code with: <asp:Label id="LogosLabel" runat="server" Text='<%# Eval("Logos") %>' /> Everything is working great except for the double URL. Any ideas on that one?
|
Color7

msg:4236488 | 12:02 am on Nov 30, 2010 (gmt 0) |
Any ideas on this?
|
|