Link to home
Start Free TrialLog in
Avatar of PNKJ
PNKJ

asked on

passing multiple parameters in hyperlink in datagrid and underline the hyperlink

<asp:HyperLinkColumn DataNavigateUrlField="xno" DataNavigateUrlFormatString="Listpage.aspx?Action=Edit&id={0}"
                                                      DataTextField="xNo" HeaderText="Name"></asp:HyperLinkColumn>


I have to pass multiple parameters in hyperlink and also make the hyperlink underline. What is the syntax for the same?Is there any code required in code behind. I am using vb.net
ASKER CERTIFIED SOLUTION
Avatar of the_paab
the_paab

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bsdotnet
bsdotnet

if you are referring multiple data fields to appear in asp:HyperLinkColumn, I think you will have to do it in your sql statement, "select 'action=edit&id=' + xNo + '&field2=' + field2 as Link1, xNo, field3 from table1"
<asp:HyperLinkColumn DataNavigateUrlField="Link1" DataNavigateUrlFormatString="Listpage.aspx?{0}"
                                             DataTextField="xNo" HeaderText="Name"></asp:HyperLinkColumn>

If you are using asp.net 2.0, can try grid view instead.
      <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:HyperLinkField  DataNavigateUrlFields="name,age" DataNavigateUrlFormatString="Listpage.aspx?Action=Edit&id={0}&age={1}" DataTextField="name" HeaderText="Name"></asp:HyperLinkField>
            </Columns>
        </asp:GridView>