TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mat cupryk
NA
1
0
need to pass two variables to a cascading function in ajax .net
Aug 1 2008 10:11 PM
I need to populate the cddDay where it takes two parameters from the other cascading drop downs
GetDayList ==> how should i modify the below code for this to work.
<ajaxToolkit:CascadingDrop
Down ID="cddMonth" runat="server" Category="Month"
TargetControlId="ddlMonth"
LoadingText="[Loading Months...]"
ServicePath="../LocationSe
rvice.asmx
"
ServiceMethod="GetMonthLis
t" Enabled="True" />
<ajaxToolkit:CascadingDrop
Down ID="cddYear" runat="server" Category="Year"
TargetControlId="ddlYear"
LoadingText="[Loading Year...]"
ServicePath="../LocationSe
rvice.asmx
"
ServiceMethod="GetYearList
" Enabled="True" />
<ajaxToolkit:CascadingDrop
Down ID="cddDay" runat="server" Category="Day"
TargetControlId="ddlDay"
LoadingText="[Loading Year...]"
ServicePath="../LocationSe
rvice.asmx
"
ServiceMethod="GetDayList"
Enabled="True" />
</td>
<td align="left" bordercolor="#f6cccc" height="35" style="width: 60%">
<asp:DropDownList style="position: static" Font-Size="Smaller" Font-Bold="true" id="ddlMonth" Runat="Server"></asp:DropD
ownList>&n
bsp;
<asp:DropDownList style="position: static" Font-Size="Smaller" Font-Bold="true" id="ddlDay" Runat="Server"></asp:DropD
ownList>&n
bsp;
<asp:DropDownList style="position: static" Font-Size="Smaller" Font-Bold="true" id="ddlYear" Runat="Server"></asp:DropD
ownList>&n
bsp;
[WebMethod(Description = "Populate a year list.")]
[System.Web.Script.Service
s.ScriptMe
thod]
public AjaxControlToolkit.Cascadi
ngDropDown
NameValue[
] GetYearList(string knownCategoryValues, string category)
{
List<CascadingDropDownName
Value> yearList = new List<CascadingDropDownName
Value>();
// Year list can be changed by changing the lower and upper
// limits of the For statement
int i = 1;
for (int intYear = DateTime.Now.Year - 18; intYear >= DateTime.Now.Year - 99; intYear--)
{
yearList.Add(new CascadingDropDownNameValue
(intYear.T
oString(),
(i++).ToString()));
}
return yearList.ToArray();
}
//////////////////////////
//////////
//////////
//////////
//////////
//////////
//////////
/
[WebMethod(Description = "Populate a month list.")]
[System.Web.Script.Service
s.ScriptMe
thod]
public AjaxControlToolkit.Cascadi
ngDropDown
NameValue[
] GetMonthList(string knownCategoryValues, string category)
{
List<CascadingDropDownName
Value> monthList = new List<CascadingDropDownName
Value>();
monthList.Add(new CascadingDropDownNameValue
("January"
, "1"));
monthList.Add(new CascadingDropDownNameValue
("February
", "2"));
monthList.Add(new CascadingDropDownNameValue
("March", "3"));
monthList.Add(new CascadingDropDownNameValue
("April", "4"));
monthList.Add(new CascadingDropDownNameValue
("May", "5"));
monthList.Add(new CascadingDropDownNameValue
("June", "6"));
monthList.Add(new CascadingDropDownNameValue
("July", "7"));
monthList.Add(new CascadingDropDownNameValue
("August",
"8"));
monthList.Add(new CascadingDropDownNameValue
("Septembe
r", "9"));
monthList.Add(new CascadingDropDownNameValue
("October"
, "10"));
monthList.Add(new CascadingDropDownNameValue
("November
", "11"));
monthList.Add(new CascadingDropDownNameValue
("December
", "12"));
return monthList.ToArray();
}
//////////////////////////
//////////
//////////
//////////
//////////
//////////
//////////
/
[WebMethod(Description = "Populate a days list for a specific month and year.")]
[System.Web.Script.Service
s.ScriptMe
thod]
public AjaxControlToolkit.Cascadi
ngDropDown
NameValue[
] GetDayList(string knownCategoryValues, string category, int year, int month)
{
List<CascadingDropDownName
Value> dayList = new List<CascadingDropDownName
Value>();
int NumberOfDays = DateTime.DaysInMonth(year,
month);
for (int day = 1; day <= NumberOfDays; day++)
{
dayList.Add(new CascadingDropDownNameValue
(day.ToStr
ing(), day.ToString()));
}
return dayList.ToArray();
}
//////////////////////////
//////////
//////////
//////////
//////////
//////////
//////////
///
Reply
Answers (
0
)
window.open not works in safari
AJAX Problem. Please Help!