Tech Off Thread

6 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

hyperlink in a column

Back to Forum: Tech Off
  • User profile image
    Rake

    here is the code for the grid, in this column

    <asp:BoundColumn DataField="Path" HeaderText="Path"></asp:BoundColumn>

    i would like it to be a hyperlink to download the the software from the database which is access. what changes do i make for that to work?


    <asp:DataGrid runat="server" AutoGenerateColumns="False" Height="137px" Width="420px" BorderWidth="1px" BorderColor="Black" ID="Region0" OnItemDataBound="Item_Bound">
    <AlternatingItemStyle BackColor="White">
    </AlternatingItemStyle>

    <Columns>
    <asp:BoundColumn DataField="productName" HeaderText="productName"></asp:BoundColumn>
    <asp:BoundColumn DataField="productDesc" HeaderText="productDesc"></asp:BoundColumn>
    <asp:BoundColumn DataField="Path" HeaderText="Path"></asp:BoundColumn>
    <asp:BoundColumn DataField="dateAvailable" HeaderText="dateAvailable"></asp:BoundColumn>
    </Columns>

    <ItemStyle BackColor="LightGray">
    </ItemStyle>

    <HeaderStyle Font-Bold="True">
    </HeaderStyle>
    </asp:DataGrid>

  • User profile image
    csharp1171

    The answer is in Visual Studio IDE.  Right-click the datagrid, go to Property Builder, then Columns then add a Hyperlink Column.  Or you could create a template column and wrap the <a> tags around it.

  • User profile image
    Rake

    i don't have  Visual Studio and i coding this in frontpage 03. Could you give me an example? 

  • User profile image
    csharp1171

    <asp:HyperLinkColumn Target="_blank" DataNavigateUrlField="Path" DataTextField="Path"></asp:HyperLinkColumn>

  • User profile image
    Rake

    ok but the  DataNavigateUrlField="Path part needs to query the access db for the path so how would i do that?

  • User profile image
    Rake

    GOT IT <asp:HyperLinkColumn DataNavigateUrlField="path" Text="Download Software"/>

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.