Calendar using CalendarExtender -first time view

asp.net Nice, France
  • 12 years ago

    Hello all,

     I am new to .Net.I inserted calendar display for two text boxes (Start Date and End Date).When I click on the calendar for the first time, the image is very crude and not properly displayed but after the first click the calendars for both the text boxes are perfect.I am not able to understand where the problem is .Here is my related piece of code:

     

    <asp:FormView ID="fvProjectDetails" runat="server"
        DataKeyNames="ProjectID" DataSourceID="esProjectDetailsDataSource"
        DefaultMode="Edit">
        <HeaderTemplate>
        <span class="textHeader">Step 1. Edit Project Information<br /></span>              
        </HeaderTemplate>
        <InsertItemTemplate>
            <p>
                Title: <br /><asp:TextBox ID="txtTitle" runat="server"
                    Text='<%# Bind("Title") %>' BorderStyle="Solid" BorderWidth="1px" Width="75%" />
                <br />Start Date: <br />
    <ajaxToolkit:CalendarExtender ID="calendarStartDate1" runat="server" TargetControlID="txtStartDateI" PopupButtonID="ImageButton1" format="MM/dd/yyyy"
                     >
                    </ajaxToolkit:CalendarExtender>
                     <asp:TextBox ID="txtStartDateI" runat="server" Text='<%# Bind("StartDate") %>' BorderStyle="Solid" BorderWidth="2px"
                Width="50%" AutoPostBack="True">
                </asp:TextBox>
                <asp:ImageButton runat="Server" ID="ImageButton1" ImageUrl="ico_calendar.gif" AlternateText="Click here to display calendar"/>
                 <br />
                End Date: <br />    
      <ajaxToolkit:CalendarExtender ID="calendarEndDate1" runat="server" TargetControlID="txtEndDateI" PopupButtonID="ImageButton2" format="MM/dd/yyyy"
                     >
                    </ajaxToolkit:CalendarExtender>
                    <asp:TextBox ID="txtEndDateI" runat="server"
                    Text='<%# Bind("EndDate") %>' BorderStyle="Solid" BorderWidth="2px"
                    Width="50%" AutoPostBack="True">
                    </asp:TextBox>  
           <asp:ImageButton runat="Server" ID="ImageButton2" ImageUrl="ico_calendar.gif" AlternateText="Click here to display calendar"/>
                <br />
     

     -Thanks,

    Sravani. 

     

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“We better hurry up and start coding, there are going to be a lot of bugs to fix.”