here in this Example when user will click on username then it will redirect to
http://xyz.com/ShowUser.aspx?id={0}&city={1} this page
and it will pass customer id and city .
<asp:SqlDataSource id="datasource1" runat="server" SelectCommand="SELECT CustomerID, CompanyName, City FROM Customers"
/>
<asp:GridView id="gridview1" DataSourceID="datasource1" runat="server"
AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="CustomerID" HeaderText="BoundField" />
<asp:HyperLinkField
DataTextField="CustomerName"
DataNavigateUrlFields="CustomerID,City"
DataNavigateUrlFormatString=
"http://xyz.com/ShowUser.aspx?id={0}&city={1}" />
</Columns>
</asp:GridView>
No comments:
Post a Comment