Hyperlink\HTML Table

Discussion in 'ASP .Net' started by gh, May 30, 2008.

  1. gh

    gh Guest

    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
     
    gh, May 30, 2008
    #1
    1. Advertising

  2. gh

    Waldy Guest

    > 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.
     
    Waldy, May 30, 2008
    #2
    1. Advertising

  3. gh

    Munna Guest

    On May 30, 6:34 pm, gh <> 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
     
    Munna, May 30, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Williams
    Replies:
    2
    Views:
    1,140
    Jacob Yang [MSFT]
    Aug 12, 2003
  2. Rio
    Replies:
    4
    Views:
    1,204
  3. davetichenor
    Replies:
    1
    Views:
    850
    Eliyahu Goldin
    Oct 30, 2006
  4. Ken
    Replies:
    1
    Views:
    391
    Alvin Bruney
    Aug 16, 2003
  5. Dave
    Replies:
    0
    Views:
    963
Loading...

Share This Page