1

我有一个如下更新面板:

<asp:UpdatePanel ID="UpdatePanel_SomeDate" UpdateMode="Conditional"  runat="server">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="IsMail" />
    </Triggers>
    <ContentTemplate>
        <table runat="server" id="MailDateTable">
            <tr id="MailDateTableRow" runat="server">
                <td nowrap="true" valign="top"  width="180px" class="ms-formlabel">
                    <h3 class="ms-standardheader">
                        <nobr>Mailing Date<span class="ms-formvalidation"> *</span></nobr>
                    </h3>
                </td>
                <td valign="top"  width="480px" class="ms-formbody">
                    <span dir="none">
                        <TestDate:DatePicker runat="server" ID="MailingDate" AllowEmpty="false" CalloutEnabled="true" ValidationEnabled="true" />
                    </span>
                </td>
            </tr>
        </table>
    </ContentTemplate>
</asp:UpdatePanel>

在部分回发期间,我需要设置MailingDate.visible = false或为真(基于 IsMail 值)。MailingDate是用户控件 ID。

TestDate:DatePicker在这里,我在用户控件中有一个日历图像。通过单击它,我正在为文本框选择日期值。

现在的问题是,如果我visible = true在部分回发期间做出或错误,则此图像不会出现。我看不到图像。请帮忙。

我在 datepicker 用户控件中有一些代码,Page_Load如下所示,它会导致任何问题吗?

if (this.Enabled)
{
    string script = "$(function(){$(\".datepicker\").datepicker({ showOn: 'button', buttonImage: '/images/calendar.gif', buttonImageOnly: true, buttonText: 'Select a date', onSelect:" + ( OnSelect ?? "function(){}" ) + " });});";
    this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "DatePickerScriptKey", script, true);
    this.Page.RegisterStyleBlock( "DatePickCss", ".ui-datepicker{ display: none; }" );
}
4

0 回答 0