Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 带有CalendarExtender的TextBox的.Text属性始终为空_C#_Asp.net_Webforms - Fatal编程技术网

C# 带有CalendarExtender的TextBox的.Text属性始终为空

C# 带有CalendarExtender的TextBox的.Text属性始终为空,c#,asp.net,webforms,C#,Asp.net,Webforms,我已经很久没有使用asp.net web表单了,我需要一些复习。我正在对一个旧应用程序做一些修改 <asp:TextBox ID="Text_DatePerformed" runat="server" CssClass="style_default" Font-Size="8pt" Width="75px" ReadOnly="true"> </asp:TextBox> <asp:CalendarExte

我已经很久没有使用asp.net web表单了,我需要一些复习。我正在对一个旧应用程序做一些修改

<asp:TextBox 
    ID="Text_DatePerformed" 
    runat="server" 
    CssClass="style_default" 
    Font-Size="8pt" 
    Width="75px" 
    ReadOnly="true">
</asp:TextBox>

<asp:CalendarExtender 
    ID="CalendarExtender2" 
    TargetControlID="Text_DatePerformed" 
    Format="MM/dd/yyyy" 
    runat="server" />

设置
readonly=false
否则ViewState不会将其持久化

<asp:TextBox 
    ID="Text_DatePerformed" 
    runat="server" 
    CssClass="style_default" 
    Font-Size="8pt" 
    Width="75px" 
    ReadOnly="false">
</asp:TextBox>
<asp:TextBox 
    ID="Text_DatePerformed" 
    runat="server" 
    CssClass="style_default" 
    Font-Size="8pt" 
    Width="75px" 
    ReadOnly="false">
</asp:TextBox>
 Text_DatePerformed.Attributes.Add("readonly", "readonly");