admin管理员组文章数量:1417461
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
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
Share Improve this question edited May 2, 2011 at 5:45 Akram Shahda 14.8k5 gold badges47 silver badges67 bronze badges asked May 2, 2011 at 5:30 kumarkumar 232 silver badges5 bronze badges 2- So, what problems do you have with doing that? What is your question? – Oded Commented May 2, 2011 at 5:35
- You want to open popup window by clicking the hyperlink? – Waqas Raja Commented May 2, 2011 at 5:40
3 Answers
Reset to default 2Try 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>
You can use template field and Row Command Method with the use of
give mand id as the ProblemId and Command Name as HyperLink(or the name u want)
and in rowCommand Event
check e.mandName=="HyperLink"
then do what ever u want in java script
ressponse.write(window.open('http://www.domain.','','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no'));
Reading is what you need.
More Reading is preferred.
本文标签: chyperlink column in datagrid aspnetStack Overflow
版权声明:本文标题:c# - hyperlink column in datagrid asp.net - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745261937a2650394.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论