I have a DataGrid that's bound to a DataSet, and I'd like to make one of the columns a hyperlink. I have this in the page
I thought I could just change to something likeCode:<asp:TemplateColumn HeaderText="Agency"> <ItemTemplate> <asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Agency") %>'> </asp:Label> </ItemTemplate>
but I guess it doesn't like that, getting an error - "The server tag is not well formed." I'm thinking I may need to use something like Chr(62) for the greater than sign (well, not quite as using C#), but is that the workaround? Or is there another way?Code:<asp:Label runat="server" Text='<%# "<a href='Agencies.aspx'>" + DataBinder.Eval(Container, "DataItem.Agency") + "</a>" %>'>
Thanks,
Mike




Reply With Quote