How to make a hyperlink through GridView column value?
- by avirk
I want here that user can see the answer under the question by selecting its heading. The question should be a hyperlink to redirect me on the page Answer.aspx. I mean to say that when user take cursor over the How to do this? it should redirect the user to the desired page. How can I do that?
here is the code
<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>