Hyperlink\HTML Table

G

gh

I have a HTML table that I have labels in several cells and I populate
them in the Page Load event, from a dataset. I have a hyperlink in one
cell that I want to display a website address in. I tried the markup
below but it doesn' t work. The cell is blank.

<tr>
<td>
&nbsp;</td>
<td>
<asp:HyperLink ID="lblWebsite" runat="server"
NavigateUrl='<%# DataBinder.Eval(Container,
"DataItem.WEBSITEADDRESS") %>'
ImageUrl=''
Text='<%# Eval("WEBSITEADDRESS") %>'></asp:HyperLink>
</td>
<td>
&nbsp;</td>
</tr>

If I use the following to populate the Hyperlink, it displays the
website address ok, but it is not a link. How do I do this?

lblWebsite.Text = ds.Tables[0].Rows[0]["WEBSITEADDRESS"].ToString();


Thanks
 
W

Waldy

If I use the following to populate the Hyperlink, it displays the website
address ok, but it is not a link. How do I do this?

lblWebsite.Text = ds.Tables[0].Rows[0]["WEBSITEADDRESS"].ToString();

It will not be shown as a link if the NavigateUrl property is blank.
 
M

Munna

I have a HTML table that I have labels in several cells and I populate
them in the Page Load event, from a dataset.  I have a hyperlink in one
cell that I want to display a website address in.  I tried the markup
below but it doesn' t work.  The cell is blank.

   <tr>
                 <td>
                     &nbsp;</td>
                 <td>
                     <asp:HyperLink ID="lblWebsite" runat="server"
                     NavigateUrl='<%# DataBinder.Eval(Container,
"DataItem.WEBSITEADDRESS") %>'
                     ImageUrl=''
                     Text='<%# Eval("WEBSITEADDRESS") %>'></asp:HyperLink>
                 </td>
                 <td>
                     &nbsp;</td>
             </tr>

If I use the following to populate the Hyperlink, it displays the
website address ok, but it is not a link.  How do I do this?

lblWebsite.Text = ds.Tables[0].Rows[0]["WEBSITEADDRESS"].ToString();

Thanks

Hi

Did you also tried to set up the navigate url of lblWebsite in item
databound?

Thanks

Munna

www.munna.shatkotha.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,701
Latest member
XavierQ83

Latest Threads

Top