Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Hyperlink\HTML Table (http://www.velocityreviews.com/forums/t617647-hyperlink-html-table.html)

gh 05-30-2008 12:34 PM

Hyperlink\HTML Table
 
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

Waldy 05-30-2008 01:48 PM

Re: Hyperlink\HTML Table
 
> 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.



Munna 05-30-2008 02:06 PM

Re: Hyperlink\HTML Table
 
On May 30, 6:34*pm, gh <g...@att.net> wrote:
> 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


All times are GMT. The time now is 10:54 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.