Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Ajax Calendarextender's css is only applied after a postback

$
0
0

The following shows what the calendar looks like when the page is first loaded and the New Record button is clicked and the FormView mode is changed to Insert. 

Calendar Before Postback

Here is the HTML and cs (with the immaterial parts removed for brevity).

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"><asp:UpdatePanel runat="server" ID="UpdatePanel_FormView1" UpdateMode="Conditional" ><ContentTemplate><asp:FormView ID="FormView1" runat="server" Width="100%" DataSourceID="SqlDataSource1"<InsertItemTemplate><asp:TextBox ID="TextBox_CLBT_DATE" runat="server" ReadOnly="true"
                        Text='<%# String.Format(DateTime.Now.ToString("dd-MMM-yyyy HH:mm:ss")) %>'  /><asp:CalendarExtender ID="CalendarExtender_DUE_DATE" runat="server"
                        Enabled="True" CssClass="cal_Theme1"
                        TargetControlID="TextBox_CLBT_DATE"
                        PopupButtonID="ImageButton_Calendar"
                        OnClientShowing="showCurrentDate"
                        Format="dd-MMM-yyyy HH:MM:ss"/>
protected void Button_NewRecord_Click(object sender, EventArgs e)
{
    FormView1.ChangeMode(FormViewMode.Insert);
    FormView1.DataBind();
    UpdatePanel_FormView1.Update();
}

This what is looks like when a DropDownList's SelectedIndexChanged event is activated.

After PostBack

Here is the code for the DropDownList (less immaterial objects)

protected void DropDownList_SOURCES_NAME_SelectedIndexChanged(object sender, EventArgs e)
{
    UpdatePanel_FormView1.Update();
}

Can anyone explain why this is happening and perhaps how to correct it?

Thanks in advance for your time and effort.


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>