[RESOLVED] gridview column hyperlinks
Hi,
I would like to transform the data in the column into hyper link.
let's say if i have "apple" in my column , when clicked on it i wud like it to go to "microsoft.com/apple" . Any tip will be apprciated. THx
my current gridview code looks like this
Quote:
<asp:TemplateField HeaderText="Status">
<EditItemTemplate>
<asp:TextBox ID="txtStatus" runat="server" Text='<%# Bind("Status") %>' Width="60" Font-Size="8" Font-Names="tahoma" ></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label12" runat="server" Text='<%# Bind("Status") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
Re: gridview column hyperlinks
ok,
i managed to replace the string to hyperlink with the following code
vb Code:
<asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Eval("status") %>' NavigateUrl="#"></asp:HyperLink>
instead of
vb Code:
<asp:Label ID="Label12" runat="server" Text='<%# Bind("Status") %>'></asp:Label>
but don't know how to get the value of the string ex: microsoft.com\thevalue
thx
Re: gridview column hyperlinks
i got it working with the following code
vb Code:
<asp:HyperLink ID="HyperLink1" runat="server" Text='<%# Bind("[CLIENT]") %>' Target="_blank" NavigateUrl='<%# "https://xxxxxxxxxxxxxxxx?txtxxxxxxxx=" + Eval("Client")%>'></asp:HyperLink>
Re: [RESOLVED] gridview column hyperlinks
Hello,
I would strongly encourage you to do this work in the code behind for the application page, rather than bind it in the ASPX markup. The code you are creating belongs there, and it allows for a cleaner separation between your UI and the code.
Gary