Usage of Link button in Grid in dot net

Posted by Gokul under Regular Expressions on 4/4/2011 | Points: 10 | Views : 1422 | Status : [Member] | Replies : 2
Dear Friends
Can any one tell hoe to place a link button in a grid? I am working in a project where there is a grid. The grid should contain likk buttons and if the user clicks the link button , it should be navigated to a new page.




Thanks in Advamce.

Thanks and Regards,
GokulNath Nithy.



Responses

Posted by: Prabhakar on: 4/4/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi Gokul

i think you use. . hyperlink field Like

<Columns>
<asp:HyperLinkField NavigateUrl="~/BPLSearch.aspx" Text="Go" />
</Columns>



Best Regard's
Prabhakar

Gokul, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ndebata on: 4/13/2011 [Member] Starter | Points: 25

Up
0
Down
Hi try to use a template field in Columns as bellow


<Columns>
<asp:TemplateField HeaderText="Name" >
<ItemTemplate>
<asp:LinkButton ID="lnkbtn" runat="server" Text='<%# Bind("Name") %>'
CausesValidation="false" CommandName="Show" CommandArgument='<%# Bind("ID") %>'>LinkButton</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>


Gokul, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response