Basic Date Picker Forums

Welcome to Basic Date Picker Forums Sign in | Join | Help
in Search

BDP with asp.net Atlas controls

Last post 09-02-2006, 9:05 AM by geoffrey.mcgill. 10 replies.
Sort Posts: Previous Next
  •  02-03-2006, 12:00 PM 429

    BDP with asp.net Atlas controls

    I am experimenting with a small app that uses both the basic date picker and Atlas (atlas.asp.net)

    On the first visit to the page the control has all the display properites (css).  Once a post back is captured by Atlas the style sheets are removed from the date picker.  There also seem be some odities with functionality after a call back is executed, but I have not been able to confirm this.

    Does anyone know of a workaround for this problem?

    Jason


    Jason Meckley
    Programmer
    Specialty Bakers, Inc.
  •  05-19-2006, 11:33 AM 522 in reply to 429

    Re: BDP with asp.net Atlas controls

    I have the same issue when using the basic date picker on a page with Atlas controls, after an atlas call back the css style is stripped from the control, leaving unformmatted links.  The date picker is still functional but after another call back it fails to return any data and Internet explorer crashes completly. This means that i currently cannot use both atlas and the bdp on the same page.

    Without the basic datepicker on the page it works perfectly - updating only a portion of the page without posting the whole thing back to the server.  The error only happens in IE, both firefox and opera function as expected

    To save posting my entire page - i mocked up a simple demo that utilises an atlas update panel triggered by a button click.  This simply increments a counter on a label.

    bdpatlas.aspx - source:

    <%@ Page Language="VB" %>

    <%@ Register Assembly="BasicFrame.WebControls.BasicDatePicker" Namespace="BasicFrame.WebControls" TagPrefix="BDP" %>

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

    <script runat="server">

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)

    Label1.Text += 1

    End Sub

    </script>

    <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">

    </atlas:ScriptManager>

    <div>

    <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />

    <atlas:UpdatePanel ID="UpdatePanel1" runat="server">

    <ContentTemplate>

    <asp:Label ID="Label1" runat="server" Text="1"></asp:Label>

    </ContentTemplate>

    <Triggers>

    <atlas:ControlEventTrigger ControlID="Button1" EventName="Click" />

    </Triggers>

    </atlas:UpdatePanel>

    </div>

    <BDP:BasicDatePicker ID="BasicDatePicker1" runat="server">

    </BDP:BasicDatePicker>

    </form>

    </body>

    </html>

    Thanks

    Alex - (reposted as original post got deleted accidentally)

  •  05-22-2006, 7:23 PM 524 in reply to 522

    Re: BDP with asp.net Atlas controls

    alex,

    Thank you for posting this, I thought I was going mad when this started happening.  I am using the beta 1.2 and was testing IE7 beta and Firefox and all worked fine, but when I gave the pages to my tester, it kept crashing his browser.  I moved back to IE6 and got the same problem. I finally narrowed the problem down to IE6 and basicdatepicker.  Any help with this problem would be greatly appreciated, especially if the solution can be applied to basicdatepicker beta 1.2.

    Thanks.
  •  05-23-2006, 4:58 PM 529 in reply to 524

    Re: BDP with asp.net Atlas controls

    Hi jmeckley, alex and clieman,

    Thanks for taking the time to post to the forums.

    We are testing the date pickers with Atlas.NET and our initial test did not produce the same results you are experiencing, so we are currently trying on several different other machines. The issue may be caused by a memory leak issue that IE is susceptible too, although that is just a guess at this point. There is a solution if that is the problem.

    This is our #1 priority at the moment, so I will post again when we have this figured out. Hopefully real soon.

    We apologize for the inconvenience.


    Thanks,
    Geoffrey McGill
    ----------------------------------------
    Coolite Inc.
    Email: support [at] coolite [dot] com
    Phone: +1(888)775-5888
  •  05-25-2006, 5:17 PM 546 in reply to 529

    Re: BDP with asp.net Atlas controls

    I think you may be right about the memory leak, or something along that line. The page will open for me with the date picker on it, but once I start changing the selection of a grid using comboboxes and the such, that's when the browser crashes.

    Thank you for putting this as #1 priority. Looking forward to the fix being posted.
  •  06-07-2006, 3:42 PM 571 in reply to 429

    Re: BDP with asp.net Atlas controls

    Hi jmeckley, alex and clieman,

    We think we may have found an acceptable and very simple workaround.

    First off, you need to download and install the latest build. The build number is still 1.2.2071, but the control has been updated, so you should uninstall and reinstall. See http://www.basicdatepicker.com/download/downloadproduct.aspx

    You may notice that there is a new Visual Studio .NET 2005 installer. This will install the component icons directly into you Visual Studio .NET 2005 ToolBox. Enjoy.

    Once you have the latest build installed, modify the BasicDatePicker controls on your page to not automatically output the basicdatepicker.js and basicdatepicker.css files. You still need these files, but you'll hard-code the paths into the page <head> instead of relying on BDP to include.

    Set the RenderJavaScript and RenderStyleSheet properties to "None". Example:

    <BDP:BasicDatePicker ID="BasicDatePicker1" runat="server" RenderJavaScript="None" RenderStyleSheet="None" />

    Then add the following lines into the <head> of your WebForm. Example:

    <style type="text/css"><!-- @import url(/aspnet_client/basicframe_webcontrols_basicdatepicker/1_2_2071/basicdatepicker.css); --></style>
    <script type="text/javascript" src="/aspnet_client/basicframe_webcontrols_basicdatepicker/1_2_2071/basicdatepicker.js"></script>

    Of course you may need to change the paths, especially if you are using the webserver built into VS.NET 2005. Virtual Pathing DOES NOT work with the built in webserver. You may need to drag/drop a copy of the /aspnet_client/ folder into your project root and change the paths above to point to the Application Root or Relative Path. Example:

    Virtual Root:
    /aspnet_client/basicframe_webcontrols_basicdatepicker/1_2_2071/basicdatepicker.css

    Application Root:
    ~/aspnet_client/basicframe_webcontrols_basicdatepicker/1_2_2071/basicdatepicker.css

    Relative Path:
    aspnet_client/basicframe_webcontrols_basicdatepicker/1_2_2071/basicdatepicker.css


    Once those edits are complete the date picker should work as expected in IE (with no crashing).

    If you are getting a JavaScript error, please check that the paths to the basicdatepicker.js and basicdatepicker.css are correct. A JavaScript error can be a good sign, because it means things are almost working properly, but the paths to the js and css are not quite right.

    Another new property that may come in handy is the ResourcePath. All the required files (images, css, js) must be placed in the same directory, although you can now point to that directory by having to edit only one property. The following directory demonstrates how to point the date picker to find the required files within the custom directory "/datepicker/". Example:

    <BDP:BasicDatePicker ID="BasicDatePicker1" runat="server" ResourcePath="~/datepicker/" />

    The ResourcePath property is also included within BDPLite v1.2.

    At the moment, the atlas fix above will not work with BDPLite, but we are expecting a BDPLite solution soon.

    We have posted a test page to demonstrate the use of BasicDatePicker on a simple ATLAS page. See http://atlas.testing.basicdatepicker.com/simpletest.aspx

    In the near future we will be creating and posting many more ATLAS/AJAX samples. If you would like to see something in particluar, please send us a note (support@basicdatepicker.com) and we will do our best to fill your request.

    In summary, to prevent BasicDatePicker from crashing IE when using ATLAS:
    1. Set the RenderJavaScript and RenderStyleSheet properties to "None".
    2. Manually include the basicdatepicker.js and basicdatepicker.css files within the <head>.

    Hope this helps.


    Thanks,
    Geoffrey McGill
    ----------------------------------------
    Coolite Inc.
    Email: support [at] coolite [dot] com
    Phone: +1(888)775-5888
  •  06-08-2006, 1:47 AM 580 in reply to 571

    Re: BDP with asp.net Atlas controls

    Im happy to say it works perfectly - thank you very much

    Luckily it works with Masterpages as well, as ive only needed to add the links once, in the head of the masterpage.  Now just 50 tags to update and im set to ATLASify the rest of my app.

    Excellent work

    Alex

    (nice to see my example in use there ;) )

  •  06-16-2006, 9:39 AM 589 in reply to 571

    Re: BDP with asp.net Atlas controls

    There are two other <script> blocks that you may need to manually include in the HTML of your page if your page does not render at least one date picker on initial Page_load.

    You may be using a GridView, Panel or similar control which does not render a date picker on initial page_load, but only on a postback/callback. For example, the edit item Template on a GridView.

    In the sample above a date picker is written to the page on initial Page_load.  That initial date picker writes the required start-up script and Culture script blocks to the page and on all subsequent postbacks/callbacks the JavaScript is there for the date pickers to use.

    We overlooked that if you do not have a date picker visible on Page_load you have to manually include the following two <script> blocks at (or near) the bottom of the page html. One example is for basicdatepicker, and one for bdplite. See:

    <script type="text/javascript"><!--
    /*  Basic Date Picker Inc. 2004-2006. All rights are reserved. Unauthorized use prohibited. Visit http://www.basicdatepicker.com/ for more info. Version 1.2.2071  */ var basicDatePicker = (window.BasicDatePicker) ? new BasicDatePicker() : "NoJS";function basicDatePickerButtonElementClick(b, v, l, params, stayOpen){if(basicDatePicker == "NoJS")alert("Unable to find script library '/aspnet_client/basicframe_webcontrols_basicdatepicker/1_2_2071/basicdatepicker.js'. Try placing this file manually by uploading the /aspnet_client directory to your web application root.\n\nTypically the aspnet_client directory can be found at the following path:\nc:\\inetpub\\wwwroot\\aspnet_client\\");else if(basicDatePicker){basicDatePicker.stayOpen = stayOpen;basicDatePicker.showPopUp(b, v, l, params);}} //--></script>


    <script type="text/javascript"><!--
    /*The BDPLite calendar date picker is FREE to use and redistribute, subject to terms of license agreement. Please visit http://www.basicdatepicker.com/bdplite/ for moreinformation. Copyright Basic Date Picker Inc. 2004-2006. All rights reserved. Version 1.2.2071 */ var bdpLite = (window.BDPLite) ? new BDPLite() : "NoJS";function bdpLiteButtonElementClick(b, v, l, params, stayOpen){if(bdpLite == "NoJS")alert("Unable to find script library '/aspnet_client/basicframe_webcontrols_basicdatepicker/1_2_2071/bdpLite.js'. Try placing this file manually by uploading the /aspnet_client directory to your web application root.\n\nTypically the aspnet_client directory can be found at the following path:\nc:\\inetpub\\wwwroot\\aspnet_client\\");else if(bdpLite){bdpLite.stayOpen = stayOpen;bdpLite.showPopUp(b, v, l, params);}} //--></script>

    PLUS: Add the following Culture script block.

    <script type="text/javascript"><!--
    var basicDatePickerCulture_en_CA = {monthNames:new Array("January","February","March","April","May","June","July","August","September","October","November","December"), monthNamesAbbr:new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"), dayNames:new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"), dayNamesAbbr:new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat"), firstDayOfWeek:0};
    //--></script>

    It would be best to create your own version of the above script blocks by making a new WebForm, dropping a date picker on the page and then view the page in a browser. If you View > Source a similar block of script will be written to the page near the bottom. Copy/Paste that block of script into your ATLAS page.

    After manually including the required startup script and Culture script blocks on the page everything should work fine.

    Hope this helps.


    Thanks,
    Geoffrey McGill
    ----------------------------------------
    Coolite Inc.
    Email: support [at] coolite [dot] com
    Phone: +1(888)775-5888
  •  07-25-2006, 10:53 PM 668 in reply to 589

    Re: BDP with asp.net Atlas controls

    Can you please give a sample of how you got it working in a Datagrid as I seem to be able having issues getting it work correctly.

    I have an Atlas Update Panel which contains a repeater control which contains the BDP control.

    Basically what happens is the Partial Post back binds the repeater to a datasource so the BDP control is rendered on partial postback but with a name like rptTest_ctl00_bdpDOB - It seems to be throwing a Javascript error trying to locate <control name>Params so in my case rptTest_ctl00_bdpDOBParams

    Thanks.
  •  07-27-2006, 7:36 PM 675 in reply to 668

    Re: BDP with asp.net Atlas controls

    *bump*

    Well this thread is already at the top of the forum so it doesn't really need bumping it just needs a response from the BDP Rep - You said above you got it working in a datagrid, would you mind pasting the sample code ?

    Cheers,
    Jarred
  •  09-02-2006, 9:05 AM 777 in reply to 668

    Re: BDP with asp.net Atlas controls

    We recently added full support for the Microsoft "Atlas" Framework.

    Now you can just drag and drop a Date Picker (or Time Picker) into your atlas UpdatePanel and everything just works.

    The following Sample demonstrates how to use the DatePicker and TimePicker within an Atlas UpdatePanel while data binding to GridView and FormView controls. See http://atlas.samples.basicdatepicker.com/formview.aspx

    Atlas support has also been extended to the free date picker (BDPLite).

    You can download the latest installer (version 1.2.2411) from http://www.basicdatepicker.com/download/

    Thanks,
    Geoffrey McGill
    ----------------------------------------
    Coolite Inc.
    Email: support [at] coolite [dot] com
    Phone: +1(888)775-5888
View as RSS news feed in XML
 
Powered by Community Server, by Telligent Systems