asp:Calendar inside update panel?

Last post 08-05-2006 3:35 AM by Piotrek. 13 replies.

Sort Posts:

  • asp:Calendar inside update panel?

    06-13-2006, 10:14 PM
    • Star
      8,834 point Star
    • MorningZ
    • Member since 07-22-2002, 2:39 PM
    • Fort Lauderdale, FL
    • Posts 1,815

    Looked for a past post on this, only to see that no one's posted about this (http://forums.asp.net/search/SearchResults.aspx?q=calendar+sectionid%3a1007&o=Relevance)

    I am expecting clicking the "prev" and "next" links in a bone stock <asp:Calendar> control wrapped inside an UpdatePanel to move through the months without refreshing the page....  but, while i can hear IE "click" when i press the < or > link on the calendar header... nothing happens

    Did i miss something?   my code is as follows:

    <

    atlas:ScriptManager ID="sm1" runat="server" EnablePartialRendering="true" />

    <
    atlas:UpdatePanel runat="Server" ID="up1" RenderMode="Inline">
          
    <ContentTemplate>
                 
    <asp:Calendar runat="server" ID="cal1" />
          
    </ContentTemplate>
    </atlas:UpdatePanel>
    "If you make it idiot proof, they'll build a better idiot"
  • Re: asp:Calendar inside update panel?

    06-14-2006, 4:38 AM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368

    hello.

    i've copied your code and it runs without any problems here...

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: asp:Calendar inside update panel?

    06-14-2006, 4:48 AM
    • Member
      15 point Member
    • boshik
    • Member since 06-12-2006, 8:51 AM
    • Posts 3
    I got the same issue with month changing on calendar. Does anybody resolved it?
  • Re: asp:Calendar inside update panel?

    06-14-2006, 9:19 AM
    • Star
      8,834 point Star
    • MorningZ
    • Member since 07-22-2002, 2:39 PM
    • Fort Lauderdale, FL
    • Posts 1,815
    Luis Abreu:

    hello.

    i've copied your code and it runs without any problems here...


    Wow... thanks... i guess everything must be a-OK then code-wise

     

    *Add*
    Also took the super simple and stripped down code and put it into an Atlas project here at work, and it indeed did work as it should...    so either my Atlas install is messed up at home (Atlas-stuff works on another project though) or something else in the code is throwing the wrench in the wors

    "If you make it idiot proof, they'll build a better idiot"
  • So it appears the MasterPage is the issue

    06-14-2006, 6:42 PM
    • Star
      8,834 point Star
    • MorningZ
    • Member since 07-22-2002, 2:39 PM
    • Fort Lauderdale, FL
    • Posts 1,815

    So this works:

    <%

    @ Page Language="VB" AutoEventWireup="false" CodeFile="AtlasTest.aspx.vb" Inherits="test_AtlasTest" %>
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <
    head runat="server">
        
    <title>No MasterPage</title>
    </
    head>

    <

    body>
       
    <form id="form1" runat="server">
             
    <atlas:ScriptManager ID="sm1" runat="server" EnablePartialRendering="true" />
             
    <div>
                    
    <atlas:UpdatePanel runat="Server" ID="up1" RenderMode="Block">
                           
    <ContentTemplate>
                                   
    <asp:Calendar ID="cal1" runat="Server" />
                           
    </ContentTemplate>
                    
    </atlas:UpdatePanel>
             
    </div>
        
    </form>
    </
    body>

    </

    html>

    But this doesn't (which is using the Personal Website Starter Kit's MasterPage)

    <%

    @ Page Language="VB" MasterPageFile="~/Default.master" AutoEventWireup="false" 
      
    CodeFile="AtlasTest_UseMaster.aspx.vb" Inherits="test_AtlasTest_UseMaster" title="Using MasterPage" %>

    <

    asp:Content ID="Content1" ContentPlaceHolderID="Main" Runat="Server">
        
    <atlas:ScriptManager ID="sm1" runat="server" EnablePartialRendering="true" />
        
    <div>
               
    <atlas:UpdatePanel runat="Server" ID="up1" RenderMode="Block">
                        
    <ContentTemplate>
                                  
    <asp:Calendar ID="cal1" runat="Server" />
                        
    </ContentTemplate>
               
    </atlas:UpdatePanel>
        
    </div>
    </
    asp:Content>

     

    Anyone have any sort of explaination or work around?

    "If you make it idiot proof, they'll build a better idiot"
  • Re: So it appears the MasterPage is the issue

    06-14-2006, 6:54 PM
    • Star
      8,834 point Star
    • MorningZ
    • Member since 07-22-2002, 2:39 PM
    • Fort Lauderdale, FL
    • Posts 1,815

    So to try to figure out what isn't wrong rather than what is...

    I created a simple MasterPage:

    <%

    @ Master Language="VB" CodeFile="Default2.master.vb" Inherits="Default2" %>
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <
    head runat="server">
             
    <title>Untitled Page</title>
    </
    head>

    <
    body>
    <form id="form1" runat="server">
        
    <div>
             
    <div style="background-color: #c0c0c0; padding: 40px;">&nbsp;</div>
             
    <div style="padding: 10px;">
                    
    <asp:contentplaceholder id="Main" runat="server" />
             
    </div>
             
    <div style="background-color: #c0c0c0; padding: 40px;">&nbsp;</div>
    </div>

    </form>
    </
    body>
    </
    html>

    And changed the code i posted last post to use "Default2.master" instead of "Default.master" (which again, is the master page from PWS)...

    And..... the calendar works as it should! (grrr, this is becoming as clear as mud !)

    So the problem is not using MasterPages itself, it's something inside the Default.Master code/design/outputted HTML..... I don't even know where to start to try to find out what the hold up is

    "If you make it idiot proof, they'll build a better idiot"
  • Re: So it appears the MasterPage is the issue

    06-15-2006, 6:39 AM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368

    hello again.

    what does fiddler show on partial postback? btw, one thing that might be happening is that you're getting an invalid xml msg from a partial postback. this might happen if you have any of the forbidden xml chars placed inside the head element and this element has the runat="server" value (this is not a difficult error to get; for instance, if you put your jscript code on the head element and you perform a comparison that uses the < operator, you'll get an xml processing error on the client).

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: So it appears the MasterPage is the issue

    06-15-2006, 9:28 AM
    • Star
      8,834 point Star
    • MorningZ
    • Member since 07-22-2002, 2:39 PM
    • Fort Lauderdale, FL
    • Posts 1,815

    Aahhh... fiddler... i totally forgot that was the method of choice to debug Atlas...

    I'll mess with that tonight.. thanks for the tips

    "If you make it idiot proof, they'll build a better idiot"
  • Re: So it appears the MasterPage is the issue

    06-15-2006, 6:25 PM
    • Star
      8,834 point Star
    • MorningZ
    • Member since 07-22-2002, 2:39 PM
    • Fort Lauderdale, FL
    • Posts 1,815

    Drats... firing up Fiddler... i pull up a page that uses PWS's master page and click on the "<" and ">" of the calendar and also the page #'s of the GridView pager....   still nothing... i hear the post "click" in IE that it took my command, but the data doesn't change at all

    And as you can see in Fiddler.. it doesn't report any errors/issues

    Screenshot

    "If you make it idiot proof, they'll build a better idiot"
  • Re: So it appears the MasterPage is the issue

    06-16-2006, 5:27 AM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368

    hello again.

    what do you get in the response? any chance of posting that content here?

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: So it appears the MasterPage is the issue

    06-17-2006, 2:58 AM
    • Member
      5 point Member
    • nickfr
    • Member since 05-30-2006, 6:19 AM
    • Posts 1

    I had this exact problem and it was an issue with my head element containing the & character in a url to a javascript include as Luis suggests above

    Try taking the text output from the response in Fiddler and pasting it into something that can check the xml

    -NiCK

  • Re: So it appears the MasterPage is the issue

    06-17-2006, 3:40 AM
    • Contributor
      7,416 point Contributor
    • Garbin
    • Member since 09-17-2004, 12:35 PM
    • Sassari, Italy
    • Posts 1,506
    • ASPInsiders
      TrustedFriends-MVPs
    Hi,

    I've setup the PWS to use Atlas and added the UpdatePanel with the calendar control in the Default.aspx page, just under the "What's up Lately" section title. Result: it is working correctly, and months are switched as expected.

    Did you add any custom code to the PWS master page?
    Alessandro Gallo | Blog | My book: ASP.NET AJAX In Action
  • Re: So it appears the MasterPage is the issue

    06-17-2006, 9:06 AM
    • Star
      8,834 point Star
    • MorningZ
    • Member since 07-22-2002, 2:39 PM
    • Fort Lauderdale, FL
    • Posts 1,815

    Yes, my PWS is heavily modified...

    One thing I overlooked all this time was that I folded in Lightbox into the site, and seeing this post revealed that Atlas and Scriptilicious (which drives the Lightbox code) aren't best of friends, but incredibly that super simple fix posted in that topic, move non-Atlas javascript to under the ScriptManager, friggen worked....  unbelievable

    All right, now to get some more stuff done  :-)

    "If you make it idiot proof, they'll build a better idiot"
  • Re: So it appears the MasterPage is the issue

    08-05-2006, 3:35 AM
    • Member
      124 point Member
    • Piotrek
    • Member since 04-26-2006, 11:09 AM
    • Posts 34

    Hi.

    I have similar problem with asp:Calendar control:

    I have an UpdatePanel, in which there is a FormView data bound to ObjectDataSource. In FormView there is editing enabled. As one of edit fields I have Calendar control.

    Problem is that clicking on dates does not change anything.

    Interesting thing is that when I add another Calendar outside FormView, then everything works fine.

    Here is my code:

    <%

    @ Page Language="C#" AutoEventWireup="true" CodeFile="CustomerAccountManager.aspx.cs"

    Inherits="Popups_CustomerAccountManager" %>

    <!

    DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <

    html xmlns="http://www.w3.org/1999/xhtml">

    <

    head runat="server">

    <title>Customer Account Manager</title>

    </

    head>

    <

    body>

    <form id="form1" runat="server">

    <div class="FillColor" id="content">

    <atlas:ScriptManager ID="ScriptManagerCustomerAccountManager" runat="server" EnablePartialRendering="true">

    </atlas:ScriptManager>

    <atlas:UpdatePanel ID="UpdatePanelCustomerAccountManager" runat="server" Mode="always">

    <ContentTemplate>

    <asp:FormView ID="FormViewCustAccMan" runat="server" DataSourceID="ObjectDataSourceCustAccMan"

    OnItemUpdating="FormView1_ItemUpdating">

    <EditItemTemplate>

    <table border="1" class="BorderFrame">

    <tr>

    <td colspan="2" class="importantText">

    Customer Account Manager

    </td>

    </tr>

    <tr>

    <td>

    Name

    </td>

    <td>

    <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("Name") %>' CssClass="textBox" />

    </td>

    </tr>

    <tr>

    <td>

    E-mail

    </td>

    <td>

    <asp:TextBox ID="txtEmail" runat="server" Text='<%# Bind("Email") %>' />

    </td>

    </tr>

    <tr>

    <td>

    Phone

    </td>

    <td>

    <asp:TextBox ID="PhoneLabel" runat="server" Text='<%# Bind("Phone") %>' />

    </td>

    </tr>

    <tr>

    <td>

    Start date, end date

    </td>

    <td>

    <asp:Label ID="StartDateLabel" runat="server" Text='<%# Bind("StartDate", "{0:dd-MM-yyyy}") %>'></asp:Label>

    <asp:Calendar ID="Calendar1" runat="server" SelectedDate='<%# Bind("StartDate") %>'

    VisibleDate='<%# Bind("StartDate") %>'></asp:Calendar>

    &nbsp;

    <asp:Label ID="EndDateLabel" runat="server" Text='<%# Bind("EndDate", "{0:dd-MM-yyyy}") %>'></asp:Label>

    </td>

    </tr>

    <tr>

    <td>

    Created by, creation date

    </td>

    <td>

    <asp:Label ID="CByLabel" runat="server" Text='<%# Bind("CBy") %>'></asp:Label>

    <asp:Label ID="CDateLabel" runat="server" Text='<%# Bind("CDate", "{0:dd-MM-yyyy}") %>'></asp:Label>

    </td>

    </tr>

    <tr>

    <td>

    Updated by, update date

    </td>

    <td>

    <asp:Label ID="UByLabel" runat="server" Text='<%# Bind("UBy") %>'></asp:Label>

    <asp:Label ID="UDateLabel" runat="server" Text='<%# Bind("UDate", "{0:dd-MM-yyyy}") %>'></asp:Label>

    </td>

    </tr>

    </table>

    <asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"

    Text="Update" ValidationGroup="CustomerUpdate" CssClass="importantButton"></asp:Button>

    <asp:Button ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"

    Text="Cancel" CssClass="normalButton"></asp:Button>

    </EditItemTemplate>

    <InsertItemTemplate>

    EndDate:

    <asp:TextBox ID="EndDateTextBox" runat="server" Text='<%# Bind("EndDate") %>'>

    </asp:TextBox><br />

    CDate:

    <asp:TextBox ID="CDateTextBox" runat="server" Text='<%# Bind("CDate") %>'>

    </asp:TextBox><br />

    StartDate:

    <asp:TextBox ID="StartDateTextBox" runat="server" Text='<%# Bind("StartDate") %>'>

    </asp:TextBox><br />

    Name:

    <asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>'>

    </asp:TextBox><br />

    CBy:

    <asp:TextBox ID="CByTextBox" runat="server" Text='<%# Bind("CBy") %>'>

    </asp:TextBox><br />

    Email:

    <asp:TextBox ID="EmailTextBox" runat="server" Text='<%# Bind("Email") %>'>

    </asp:TextBox><br />

    ID:

    <asp:TextBox ID="IDTextBox" runat="server" Text='<%# Bind("ID") %>'>

    </asp:TextBox><br />

    CustId:

    <asp:TextBox ID="CustIdTextBox" runat="server" Text='<%# Bind("CustId") %>'>

    </asp:TextBox><br />

    UDate:

    <asp:TextBox ID="UDateTextBox" runat="server" Text='<%# Bind("UDate") %>'>

    </asp:TextBox><br />

    UBy:

    <asp:TextBox ID="UByTextBox" runat="server" Text='<%# Bind("UBy") %>'>

    </asp:TextBox><br />

    Phone:

    <asp:TextBox ID="PhoneTextBox" runat="server" Text='<%# Bind("Phone") %>'>

    </asp:TextBox><br />

    <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"

    Text="Insert">

    </asp:LinkButton>

    <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"

    Text="Cancel">

    </asp:LinkButton>

    </InsertItemTemplate>

    <ItemTemplate>

    <table border="1" class="BorderFrame">

    <tr>

    <td colspan="2" class="importantText">

    Customer Account Manager

    </td>

    </tr>

    <tr>

    <td>

    Name

    </td>

    <td>

    <asp:Label ID="NameLabel" runat="server" Text='<%# Bind("Name") %>'></asp:Label>

    </td>

    </tr>

    <tr>

    <td>

    E-mail

    </td>

    <td>

    <asp:Label ID="EmailLabel" runat="server" Text='<%# Bind("Email") %>'></asp:Label>

    </td>

    </tr>

    <tr>

    <td>

    Phone

    </td>

    <td>

    <asp:Label ID="PhoneLabel" runat="server" Text='<%# Bind("Phone") %>'></asp:Label>

    </td>

    </tr>

    <tr>

    <td>

    Start date, end date

    </td>

    <td>

    <asp:Label ID="StartDateLabel" runat="server" Text='<%# Bind("StartDate", "{0:dd-MM-yyyy}") %>'></asp:Label>

    <asp:Label ID="EndDateLabel" runat="server" Text='<%# Bind("EndDate", "{0:dd-MM-yyyy}") %>'></asp:Label>

    </td>

    </tr>

    <tr>

    <td>

    Created by, creation date

    </td>

    <td>

    <asp:Label ID="CByLabel" runat="server" Text='<%# Bind("CBy") %>'></asp:Label>

    <asp:Label ID="CDateLabel" runat="server" Text='<%# Bind("CDate", "{0:dd-MM-yyyy}") %>'></asp:Label>

    </td>

    </tr>

    <tr>

    <td>

    Updated by, update date

    </td>

    <td>

    <asp:Label ID="UByLabel" runat="server" Text='<%# Bind("UBy") %>'></asp:Label>

    <asp:Label ID="UDateLabel" runat="server" Text='<%# Bind("UDate", "{0:dd-MM-yyyy}") %>'></asp:Label>

    </td>

    </tr>

    </table>

    <asp:Button ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit"

    Text="Edit" CssClass="importantButton"></asp:Button>

    </ItemTemplate>

    </asp:FormView>

    &nbsp;

    <asp:ObjectDataSource ID="ObjectDataSourceCustAccMan" runat="server" OldValuesParameterFormatString="original_{0}"

    SelectMethod="GetCustomerAccManagerByCustId" TypeName="CustomerAccountManagerBLL">

    <SelectParameters>

    <asp:Parameter Name="custId" Type="Int32" />

    </SelectParameters>

    </asp:ObjectDataSource>

    </ContentTemplate>

    </atlas:UpdatePanel>

    </div>

    </form>

    </

    body>

    </

    html>
Page 1 of 1 (14 items)