Reputation: 23
I have 3 columns in my DataGrid
: a Problem id, Solution and Hyperlink.
I want that hyperlink to redirect to a new window with a parameter ProblemId. And also the size of new window should be small.
Thanks Kumar
Upvotes: 2
Views: 4340
Reputation: 1354
You can use template field and Row Command Method with the use of
give command id as the ProblemId and Command Name as HyperLink(or the name u want)
and in rowCommand Event
check e.commandName=="HyperLink"
then do what ever u want in java script
ressponse.write(window.open('http://www.domain.com','','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no'));
Upvotes: 2
Reputation: 6270
Try this:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="ProblemID" />
<asp:HyperLinkField DataNavigateUrlFields="ProblemID" DataNavigateUrlFormatString="SmallWindow.aspx?id={0}"
DataTextField="Click here" NavigateUrl="SmallWindow.aspx" />
<asp:BoundField DataField="Solution" />
</Columns>
</asp:GridView>
Upvotes: 2