<%@ Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true"
    CodeBehind="Question.aspx.cs" Inherits="BookDemo.QA.Question" %>

<%@ Import Namespace="BookDemo.QA" %>
<%@ MasterType VirtualPath="~/Master.Master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    提问标题：<asp:Label ID="lblTitle" runat="server"></asp:Label><br />
    提问内容：<asp:Label ID="lblText" runat="server"></asp:Label><br />
    提问人：<asp:Label ID="lblUserName" runat="server"></asp:Label><br />
    所属目录：<asp:Label ID="lblCatalogName" runat="server"></asp:Label><br />
    <br />
    <asp:Panel ID="panBestAnswer" runat="server" GroupingText="最佳答案" Visible="False">
        <div style="background-color: #FFCACA; padding: 2px; margin: 2px">
            内容：<asp:Label ID="lblBestAnswerText" runat="server"></asp:Label><br />
            回答者：<asp:Label ID="lblBestAnswerUserName" runat="server"></asp:Label>
            &nbsp;&nbsp;回答时间：<asp:Label ID="lblBestAnswerPostDateTime" runat="server"></asp:Label>
        </div>
    </asp:Panel>
    <br />
    <br />
    <asp:Panel ID="panAnswers" runat="server" GroupingText="回答">
        <asp:Repeater ID="rptAnswers" runat="server" OnItemCommand="rptAnswers_ItemCommand"
            OnItemDataBound="rptAnswers_ItemDataBound">
            <ItemTemplate>
                <div style="background-color: #B0D8FF; padding: 2px; margin: 2px">
                    内容：<asp:Label ID="Label1" runat="server" Text='<%# Eval("Text","{0}").HighlightKeyword(KeyWord) %>'></asp:Label><br />
                    回答者：<asp:Label ID="Label2" runat="server" Text='<%# Bind("QAUserInfo.UserName") %>'></asp:Label>
                    &nbsp;&nbsp;回答时间：<asp:Label ID="Label3" runat="server" Text='<%# Bind("PostDatetime") %>'></asp:Label>
                    <asp:Button ID="btnBestAnswer" runat="server" Text="设为最佳答案" CommandName="BestAnswer"
                        CommandArgument='<%# Bind("Id") %>' Visible="false" />
                    <asp:Button ID="btnCloseAnswer" runat="server" Text="关闭此回答" CommandName="CloseAnswer"
                        CommandArgument='<%# Bind("Id") %>' Visible="false" />
                    <hr />
                </div>
            </ItemTemplate>
        </asp:Repeater>
    </asp:Panel>
    <asp:Panel ID="panAnswer" runat="server">
        我要回答：<br />
        <asp:TextBox ID="txtAnswer" runat="server" TextMode="MultiLine" Height="129px" Width="355px"></asp:TextBox><br />
        <asp:Button ID="btnAnswer" runat="server" Text="提交" OnClick="btnAnswer_Click" />
    </asp:Panel>
</asp:Content>
