日历控件回发后,Textfield清除

时间:2014-04-28 18:10:34

标签: c# asp.net calendar

我的页面上有3个文本字段和一个日历控件。在我填写3个文本框后,然后单击日历控件上的日期,底部文本字段清除,丢失其值。其他2个文本框的值可用,不会被清除。文本框都具有相同的属性,但我无法弄清楚如何将值保留在第三个文本框中。

    <table class="auto-style2" align="center">
    <tr>
        <td class="auto-style4" style="text-align: right">Project Name:</td>
        <td style="text-align: left">
            <asp:TextBox ID="TxtProjectName" runat="server" height="32px" width="211px" MaxLength="50" OnTextChanged="TxtProjectName_TextChanged" onKeyUp="Count(this,50)" onChange="Count(this,50)" TextMode="MultiLine"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtProjectName" ErrorMessage="Field is required"></asp:RequiredFieldValidator>
        </td>
    </tr>
    </table>

<table class="auto-style2" align="center">
    <tr>
        <td class="auto-style4" style="text-align: right">Project Description:</td>
        <td style="text-align: left">
            <asp:TextBox ID="TxtDescription" runat="server" height="45px" width="211px" TextMode="MultiLine" OnTextChanged="TxtDescription_TextChanged"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TxtDescription" ErrorMessage="Field is required"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td class="auto-style4" style="text-align: right">Contact Name:</td>
        <td style="text-align: left">
            <asp:TextBox ID="TxtContactName" runat="server" Width="203px" OnTextChanged="TxtContactName_TextChanged" Height="16px"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="TxtContactName" ErrorMessage="Field is required"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td class="auto-style5">Business Area:</td>
        <td class="auto-style3">
            <asp:DropDownList ID="DDLBusinessArea" runat="server" style="text-align: left">
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td class="auto-style4" style="text-align: right">Priority:</td>
        <td style="text-align: left">
            <asp:DropDownList ID="DDLPriority" runat="server">
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td class="auto-style4" style="text-align: right">Desired Completion Date:</td>
        <td style="text-align: left">
            <asp:Calendar ID="Calendar1" runat="server">
                <SelectedDayStyle Font-Bold="True" />
                <TodayDayStyle ForeColor="#3333FF" />
            </asp:Calendar>
        </td>
    </tr>

清除的TxtContactName。

0 个答案:

没有答案