Jump to content
Fórum Script Brasil
  • 0

HyperLink ou HyperLinkField dentro de um TableCell


Pr0gr4m4d0r

Question

2 answers to this question

Recommended Posts

  • 0

Você pode trabalhar com um HyperLink normalmente:

<asp:Table ID="Table1" runat="server" CellPadding="5" GridLines="horizontal" HorizontalAlign="Center">
            <asp:TableRow>
                <asp:TableCell>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default.aspx">Link</asp:HyperLink></asp:TableCell>
                <asp:TableCell>2</asp:TableCell>
            </asp:TableRow>
            <asp:TableRow>
                <asp:TableCell>3</asp:TableCell>
                <asp:TableCell>4</asp:TableCell>
            </asp:TableRow>
        </asp:Table>

Abraços...

Link to comment
Share on other sites

  • 0
Você pode trabalhar com um HyperLink normalmente:

<asp:Table ID="Table1" runat="server" CellPadding="5" GridLines="horizontal" HorizontalAlign="Center">
            <asp:TableRow>
                <asp:TableCell>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default.aspx">Link</asp:HyperLink></asp:TableCell>
                <asp:TableCell>2</asp:TableCell>
            </asp:TableRow>
            <asp:TableRow>
                <asp:TableCell>3</asp:TableCell>
                <asp:TableCell>4</asp:TableCell>
            </asp:TableRow>
        </asp:Table>
Abraços...
ih cara, você faz diretamente no código asp? o q eu queria era trabalhar dentro do code behind da página, mas já descobri como se faz, ficou assim:
<command>
<object>

.
.
.

Dim datareader1 As OleDbDataReader
datareader1 = command1.ExecuteReader

Do While datareader1.Read
    Dim tablecell1 As New TableCell
    Dim tablerow1 As New TableRow

    Dim hyperlink1 As New HyperLink
    hyperlink1.NavigateUrl = "~/pagina.aspx?campo1=" & datareader1("campo1")
    hyperlink1.Text = datareader1("campo2")

    tablecell1.Controls.Add(hyperlink1)
    tablerow1.Cells.Add(tablecell1)
    table1.Rows.Add(tablerow1)
Loop

datareader1.Close()

de qualquer maneira, obrigado pela ajuda, abraço!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152k
    • Total Posts
      651.5k
×
×
  • Create New...