Web Forms :: How To Change Calender Depending Upon Month And Year Dropdown
May 19, 2010
I have asp.net calender control on my form and I have dropdown for month and year. and one button When I select month and year from dropdown and then when i click Button then I want to be able to go the specified month and year on my calender?
I am trying to display results based on both dropdown list selection.If a user selects Jan from 1st ddl and 2013 from 2ns ddl then results of Jan 2013 will be displayed to the user,everything works fine,I wanted to confirm the query that I have used is correct or not.
Store Procedure
Create proc usp_monthwisedata @month int, @year int
[Code].....
My concerns are:
1.Is the way of writing the Sp is correct to achieve the result.
2.Is it correct to set the onselectedindexchanged of both the ddls to 1 method i.e onselectedindexchanged="DropDownList1_SelectedIndexChanged"
Is there a way to show year and month drop down on the calendar extender like the jquery ui calendar, If so could you kindly post it for me. If not would you be willing to show me how to do the jquery ui calender with Start Theme.
I have a application where in on selection of Month and year, the datagrid should be display, username and the dates, the username and number of leaves from the database. UserName 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19..
Sam P P Susi U P - Planned Leave U - Unplanned Leave
In database i have only Username, leave start and end date.
1.How to display the dates in column in datagrid based on month and year selection.
2.How to map the dates in the datagrid with the start and end date from sql server database
I have a standard calendar control and is now showing Nov 2010 calendar on page.
I want it return to label1.text as Nov-2010. Then I want when users click forward arrow and turn Calendar to Dec 2010, I want Dec-2010 be displayed in label1.text. ie not when user click a particular date but when user click Calendar to a particular month the Calendar is showing.
I have 3 drop down lists for days,months and years,also i have a textbox to show the selected values from the 3 drop down lists when i select a month it shows in textbox and if i select another month it shows in textbox beside the first selected month.i want not to repeat the values in textbox.
i have complete date in a textbox i want to make the selected value in drop down list_days equal the day part of textbox,the selected value in drop down list_months equal the month part of textbox & the selected value in drop down list_years equal the year part of textbox to make the user update it if he want i tried to find the answer but i coudn't.
I use below code to showing date in Persian in my site
DateTime miladi = DateTime.Now; System.Globalization.PersianCalendar shamsi = new System.Globalization.PersianCalendar(); DateTime shamsidate = new DateTime(shamsi.GetYear(miladi), shamsi.GetMonth(miladi), shamsi.GetDayOfMonth(miladi)); Lbldate.Text = (shamsidate.ToString("yyyy/MM/dd", System.Globalization.CultureInfo.InvariantCulture));
But below error happen
Server Error in '/behtop website' Application.
Year, Month, and Day parameters describe an un-representable DateTime. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime.
Source Error:
Line 43: DateTime miladi = DateTime.Now; Line 44: System.Globalization.PersianCalendar shamsi = new System.Globalization.PersianCalendar(); Line 45: DateTime shamsidate = new DateTime(shamsi.GetYear(miladi), shamsi.GetMonth(miladi), shamsi.GetDayOfMonth(miladi)); Line 46: Line 47:
it worked correctly before but suddenly it make an error Why?
When I run my page and select a month with the small arrows, I get the year view instead. It looks like the width of the year is too wide and overlapping the arrows as the year is still highlighted when I hover over the arrows.It may be that theres some css styling thats overriding somewhere but how can I set the width of the year section.
I have used ajax calender in my project.I need the following requirement1. If the current month is february, then i need to disable current month all date. like this and so on ....2. If the current month is feb, then i need to show january month first and last date alone, other date should be diasbled !
DateTime ExpMonth = Convert.ToInt32(ddExpMonth); ---- DropDown(user selects a month) DateTime ExpYear = Convert.ToInt32(ddExpYear); ---- Dropdown(user selects year) Datetime ExpDate = ///// I want this part to be saved as Datetime 02/2012
I have a column in report that should display month and year together i.e single column will have both month and year(this is the first column of the table).
Previous JULY Next Every time i press Previous, a variable mymonth subtracts 1 , and when if i press Next , the variable mymonth adds 1. Previous LINK: <%# mymonth - 1 %> Next LINK: <%# mymonth + 1 %>
All the schedule from the DB is shown, using the following SQL:
SELECT DISTINCT day(mydate) FROM schedule WHERE month(mydate)=" + mymonth + " AND year(mydate)=" + myyear + " ORDER BY day(mydate) ASC"
But my problems are:
- i want to show 3 months backwards from th actual month
- when mymonth is 1 (January) 2011 for example, it would show December, November and October from 2010
- If for example, we are in JULY, it would show until APRIL backwards, and when on APRIL it wouldnt show the PREVIOUS button.