【发布时间】:2011-11-10 15:05:53
【问题描述】:
我希望在这里用户可以通过选择heading 来查看问题下的答案。问题应该是在页面Answer.aspx 上重定向我的超链接。我的意思是当用户将光标移到How to do this? 上时,它应该将用户重定向到所需的页面。我该怎么做?
这里是代码
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" Width="100%" BorderStyle="None">
<Columns>
<asp:BoundField DataField="QuestionHEAD" HeaderText="Question"
SortExpression="QuestionHEAD" HeaderStyle-ForeColor="white" HeaderStyle-BackColor="Brown"/>
<asp:BoundField DataField="Problem" HeaderText="Problem"
SortExpression="Problem" HeaderStyle-ForeColor="white" HeaderStyle-BackColor="Brown" />
<asp:BoundField DataField="Forum" HeaderText="Forum" SortExpression="Forum" HeaderStyle-ForeColor="white" HeaderStyle-BackColor="Brown"/>
<asp:BoundField DataField="Username" HeaderText="Asked By"
SortExpression="Username" HeaderStyle-ForeColor="white" HeaderStyle-BackColor="Brown" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:connectionstring %>"
SelectCommand="SELECT [QuestionHEAD], [Problem], [Forum], [Username] FROM [Question]">
</asp:SqlDataSource>
【问题讨论】:
-
请发布您当前的
GridView标记/编码 -
您是说您希望
Question列包含链接吗? -
@james johnson 是的,我想这样做。与 SO 一样,我们点击问题,它会以我想要的方式重定向我们的答案。有可能吗?