Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

$4.95 Windows Hosting at Webhost4life.com
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Webhost4Life - $4.95 Windows Hosting
 


  Sponsors  

Meet Our Sponsors

Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Adpating the popup calendar
Previous Previous
 
Next Next
New Post 6/22/2007 4:28 AM
User is offline Ricardo Pinto
13 posts
10th Ranked


Adpating the popup calendar 

Greetings!

I have a page where the user clicks a linkbutton, making a postback and showing only a .NET calendar control. Then he chooses the date and it postbacks again, storing the date in a dropdownlist. He can do this as many times as he wants, to choose a group of dates (he can also remove items from the dropdown if chose a wrong date, by clicking in another linkbutton). Everytime he opens the calendar, it shows all the previously selected dates.

Everything works as intended, but the performance is not the greatest, due to the postbacks. So I'd like to use a popup and I found one already implemented in the DNN Core. Unfortunately it receives a textbox  but I need a dropdownlist. As I don't have experience with javascript, could you give some tips on how to do change it to retreive the dates to a dropdown and to hilight the dates already selected?

Thanks in advance for your help,

Ricardo Pinto.

 
New Post 6/26/2007 8:47 AM
User is offline Ricardo Pinto
13 posts
10th Ranked


Re: Adpating the popup calendar 

Hello!

I've been working on this issue and here are some more thoughts on it:

  • The first way is to adapt the javascript so that it can retreive the dates to a dropdown and to hilight the dates already selected. As I really don't have experience with javascript this shall be my last strategy (but the first for all the js developers who can help me);
  • The second way could be to get the dates retreived and concatenated to a hidden textbox (01-02-2007::03-04-2007::21-10-2007...) and, on the next postback, get all the dates stored in the combobox... This solution looks awful!
  • The third way wouldn't use I could create a aspx control wth an aspnet:calendar and redirect to it when the user clicks the button. For this, I have to set not only the width and height but also the vertical and horizontal offset of the window, so that it shows only the calendar control.

What do you think is the best choice? Do you have any other options? Thanks again for your feedback! Regards,

Ricardo Pinto.

 

 
New Post 6/28/2007 6:26 AM
User is offline Ricardo Pinto
13 posts
10th Ranked


Re: Adapting the popup calendar 

Well, javascript was really the best way, so I had to spend some time learning the basics.

I created a new script, equal to the calendarPopup, with the following differences:

  • cmdAddException.NavigateUrl = DotNetNuke.Common.Utilities.Calendar.InvokePopupCalForCbo(lstExceptions), where InvokePopupCalFor receives the lstExceptions dropdown control instead of a texbox control;
  • calPopupSetDateCbo.arguments[0].options[calPopupSetDateCbo.arguments[0].length] = new Option(calPopupSetDateCbo.arguments[1], calPopupSetDateCbo.arguments[1], true, true), to retrieive a new item to the dropdownlist (before it was calPopupSetDate.arguments[0].value = calPopupSetDate.arguments[1], for the textbox);

 

 My html is the following:

<asp:hyperlink id="cmdAddException" runat="server" text="Adicionar Excepção" CssClass="CommandButton" BorderStyle="None" resourcekey="cmdAddException"></asp:hyperlink>

<asp:DropDownList id="lstExceptions" Runat="server" cssclass="NormalTextBox" DataTextField="ExceptionDate"DataValueField="ExceptionId" AutoPostBack="false" Width="100"></asp:DropDownList>

and my web page source is:

<a id="dnn_ctr429_PlanoformEdit_cmdAddException" class="CommandButton" href=" popupCalCbo('Cal','dnn_ctr429_PlanoformEdit_lstExceptions','dd-MM-yyyy','Janeiro,Fevereiro,Março,Abril,Maio,Junho,Julho,Agosto,Setembro,Outubro,Novembro,Dezembro','dom,seg,ter,qua,qui,sex,sáb','Today','Close','Calendar',1);" style="border-style:None;">Adicionar Excepção</a>

<select name="dnn:ctr429:PlanoformEdit:lstExceptions" id="dnn_ctr429_PlanoformEdit_lstExceptions" class="NormalTextBox" style="width:100px;">

<option value="3">13-04-2006</option>

<option value="4">15-07-2007</option>

</select>

Everything works fine (the calendar popup opens, I select a date and it is added to the dropdownlist), except one thing: later on I must save data and, when I click the save button, my code behind sees no items in the combobox (Me.lstExceptions.Items.Count is 0)!!! This means that I'm changing the items on the client-side, but cannot syncronize the changes to the server side, failing to save the changes. I believe I'm close to the solution, but cannot figure it out!

Can you help me? Thanks a lot!

Ricardo Pinto.

 
New Post 6/28/2007 4:29 PM
User is offline eck two
322 posts
8th Ranked


Re: Adapting the popup calendar 

Maybe you need to add Enablev13wstat3="True" to your DropDownList.

 
New Post 6/29/2007 6:25 AM
User is offline Ricardo Pinto
13 posts
10th Ranked


Re: Adapting the popup calendar 

Hello Ecktwo!

Thanks for your tip, but it is still not working. Maybe I should put that in the html and use also v13wstat3 methods in my code??? I will try that later...

Ricardo.

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Adpating the popup calendar
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


AfterImage Internet Consulting and SEO Services
AfterImage provides search engine optimization (SEO), Internet consulting and hosting services for the Windows platform (IIS, ASP, SQL Server).
www.afterimage.nl/
Willhite & Sharron Realtors
Exemplary service for your Seattle Real Estate needs. It's what you deserve from your Realtor®!
www.alkihomes.com
Swanzey Internet Group LLC
DotNetNuke design, development, hosting, maintenance, and training. Exclusively DotNetNuke.
www.swanzey.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP