Showing posts with label display. Show all posts
Showing posts with label display. Show all posts

Saturday, March 24, 2012

Calender control in asp.net

Hi, Could anyone please tell me how can i display datepicker when i click textbox or button and i want the date to be in textbox.

could any one give me code to do thhis? i have master page in my project

Thanks for any assistance

Have a look at the ASP.NETAJAX Calendar control.


Hi Tweety,

If you want use CalendarExtender, please download theAjax Control Toolkit. And some pretty samples are contained inside the package.

I hope this help.

Best regards,

Jonathan


Hi. thanks for both of you

im using ajax calender tool kit, jus searchin for good design(i mean css) to apply.

if u have any please suggest me.

thanks again


It really depends on your application as to what style to apply, but if you read thecalender page (specifically the theming section) it will show you how you can customize it to suit your application.


<asp:TextBoxID="TextBox5"runat="server"Width="120px"CssClass="textile"></asp:TextBox></td>

<cc1:CalendarExtenderrunat=serverTargetControlID=textbox5Format="dd/MM/yyyy">

</cc1:CalendarExtender>

im using this code.i have a pblm here once i selected date my date appears in textbox but the calender still can able to see until i clik some where on the page...

why like this?


That's how the control has been built. View thecalendar page for 3 different examples on how it behaves.


Hi Tweety,

If you want to hide the Calendar immediately after we selected a date, you should add thisOnClientDateSelectionChanged="function hideCalendar(cb) { cb.hide(); }" to your source code. OnClientDateSelectionChanged is one property of the CalendarExtendar.

Hope this helps.

Best regards,

Jonathan


Hi thanks but once a date is selected calender hide , but when i reclick the textbox it wont appears...

did i need to quote another javascript here to make calender visible when i click textbox after date selection?


Its fixed...thanks.

http://forums.asp.net/t/1067091.aspx?PageIndex=2

i found my soluntion here..

thanks for everyone.

forums.asp.net ROCKS!!!!

Wednesday, March 21, 2012

CalendarExtender, want only current month date visible

hi all,

I have a problem, I want to display days of only current month or whichever month a user selects. I mean by default calendar extender shows all dates , even if we have selected November, it will show some days of previous month and some days of next month along with current month's dates. I only want to display current month's dates.

I applied css specified in http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Calendar/Calendar.aspx

but that's changing color of each day. I was thinking by using css somehow i will hide previous and next month days, but of not avail.

please suggest,

thanks...

Hi Forums_user,

As far as I know, it is not supported now unless you modify its source code. CalendarExtender generate all the days , months and years on the client, you can find it in its source code with the name _buildDays,_buildMonths and _buildYears.

I hope this help

Best regards,

Jonathan

CalendarExtender wont display the calendar.

Hello,

I have been trying to get the CalendarExtender control to work in one of my pages work several days now. I used the sample website in the toolkit as a guide. The Calendar.aspx page in the sample website works fine if I add it to my project but when I try to use the extender on one of my pages I get a Javascript error when I click on the textbox that I have attached to the extender. The error reads:

Line: 548

Char: 13

Error: 'this._popupBehavior' is null or is not an object

If anyone out there cares, I found the problem. It would seem that a different datepicker control that I was using had a conflict with the CalendarExtender. I had been using Basic Date Picker Lite because it was the best FREE control that acted like I wanted it to. Once I removed the other control the CalendarExtender worked like a champ. The CalendarExtender even offers me more flexibility than BDPLite. Anyway, I hope that my suffering means that someone else won't have to.

CalendarExtender positioning

When binding the CalendarExtender to an target textbox, the calendar will display immediatly below the textbox.
Is there a way to control the positioning of the calender so it will appear for example abowe the textbox?

Hi,

you can use

PopupPosition="TopRight" / TopLeft / BottomLeft/ BottomRight

in CalendarExtender tag property

hope it helps


Thanks, this answered my question.
Your answer made me realize that didn't have the latest release of the toolbox installed.
The one I had didn't support the PopupPosition attribute.Thanks