|
Rank: Newbie Groups: Member
Joined: 6/6/2007 Posts: 6
|
Hello,
I’m having some problems when using DatePicker as part of a Custom Control. I’m creating a custom controls that holds some general controls (checkbox, dropdownlists, labels, textboxes, etc), and a DatePicker. This custom control has 5 instances added to a page, so it looks like a list of 5 items. Here are the 2 problems I’m having:
First:
The DatePicker included in the first Custom control shows everything perfect (arrows, FooterTemplate) but the rest of them are shown with no arrows and no FooterTemplate. I debugged the app. and the code runs perfect through the different steps, but still it DatePicker is not rendered as desired. In addition, I added a couple of DatePickers from the ToolBox to the page and they both are shown perfect, but now the DatePicker from the first Custom Control that used to work fine is shown without arrows and FooterTemplate too.
Second:
The same custom control implements IPostBackEventHandler and IPostBackEventHandler.RaisePostBackEvent is called when a checkbox included in the control is checked, right after it happens, the popup button gets disabled and the calendar can’t be shown. This happens to every single DatePicker contained by the custom controls.
Am I missing one step? Please, help me on this.
Thanks
Ernesto
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi ernesto,
Did you override PreRender in your custom control? Make sure that you call the base class's PreRender there.
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 6/6/2007 Posts: 6
|
Thanks for your quick response. I overrided RenderContents, do I have to do the same?
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Yes. I believe so. You need to call base's implementation for that one as well.
|
|
Rank: Newbie Groups: Member
Joined: 6/6/2007 Posts: 6
|
Thanks, I've been working around a it didn't work, I don't know if having the DatePicker placed inside an Atlas' UpdatePanel could be affecting.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Our DatePicker does support Atlas. Is it possible for you to post a sample project that demonstrates the problem?
|
|
Rank: Newbie Groups: Member
Joined: 6/6/2007 Posts: 6
|
A bit late, but I've been working in several things at the same time, here you have a very simple example. As soon as you click the button, the DatePicker gets disabled. I found out that if EnablePartialRendering is removed from ScriptManager or set to false, then it works fine; but this is not what we want. Thanks in advance.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" /> <asp:Button ID="Button1" runat="server" Text="Button" /> <div> </div> <atlas:UpdatePanel ID="UpdatePanel1" runat="server" Mode="Conditional"> <ContentTemplate> <eo:DatePicker ID="DatePicker1" runat="server" ControlSkinID="None" DayCellHeight="15" DayCellWidth="31" DayHeaderFormat="Short" DisabledDates="" OtherMonthDayVisible="True" SelectedDates="" TitleFormat="MMMM, yyyy" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL" TitleRightArrowImageUrl="DefaultSubMenuIcon" VisibleDate="2007-06-01"> <TitleStyle CssText="font-family:Verdana;font-size:8.75pt;padding-bottom:5px;padding-left:5px;padding-right:5px;padding-top:5px;" /> <CalendarStyle CssText="background-color:white;border-bottom-color:Silver;border-bottom-style:solid;border-bottom-width:1px;border-left-color:Silver;border-left-style:solid;border-left-width:1px;border-right-color:Silver;border-right-style:solid;border-right-width:1px;border-top-color:Silver;border-top-style:solid;border-top-width:1px;color:#2C0B1E;padding-bottom:5px;padding-left:5px;padding-right:5px;padding-top:5px;" /> <DayHoverStyle CssText="background-image:url('00040402');color:#1c7cdc;" /> <MonthStyle CssText="cursor:hand;font-family:Verdana;font-size:8pt;margin-bottom:0px;margin-left:4px;margin-right:4px;margin-top:0px;" /> <DayHeaderStyle CssText="border-bottom: #f5f5f5 1px solid" /> <SelectedDayStyle CssText="background-image:url('00040403');color:Brown;" /> <DisabledDayStyle CssText="color: gray" /> <TodayStyle CssText="background-image:url('00040401');color:#1176db;" /> <FooterTemplate> <table style="font-size: 11px; font-family: Verdana" border="0" cellSpacing="5" cellPadding="0"> <tr> <td width="30"></td> <td valign="center"><img src="{img:00040401}"></td> <td valign="center">Today: {var:today:MM/dd/yyyy}</td> </tr> </table></FooterTemplate> <TitleArrowStyle CssText="cursor: hand" /> </eo:DatePicker> </ContentTemplate> <Triggers> <atlas:ControlEventTrigger ControlID="Button1" EventName="Click" /> </Triggers> </atlas:UpdatePanel> </form>
<script type="text/xml-script"> <page xmlns:script="http://schemas.microsoft.com/xml-script/2005"> <references> </references> <components> </components> </page> </script> </body> </html>
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi,
Please check your ASP.NET AJAX version. You seem to be using the Beta, not the release version. The beta version uses prefix "atlas", whereas the release version uses "asp".
Our controls switched to support the release version early this year when MS officially released it (and took the name ASP.NET AJAX). The Beta version is no longer supported.
We have tried to run your code with the release version of ASP.NET AJAX and we do not see any problem. A few places, including the prefix atlas and the Triggers needs to be modified to switch to release version.
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 6/6/2007 Posts: 6
|
Thanks, yes unfortunately I started the app using this version and making cuick changes at this point is very risky. At least I’ll need to dedicate a good amount of time to evaluate, change, and test things. Anyway, if you have any idea on how I can make it work over this Beta version, just let me know.
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,193
|
Hi,
I do not think there is a reliable way to make it work over the Beta version. MS has changed quited a lot of things between Beta and Release version, so in order to support the Release version, we had to stop supporting the Beta version.
An alternative is to use our own CallbackPanel instead of the Beta UpdatePanel. That should always work --- again, it only works if you don't have Atlas Beta in that page, you can still have Atlas in other pages.
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 6/6/2007 Posts: 6
|
Thank you very much, I'll be working on upgrading to the new version.
Thanks
|
|