[英]load an array of dates from web service to asp.net calendar control
I am calling a web service using a service reference in c# and have collected a list of date strings (collection dates) into an array list in a public class 我正在使用C#中的服务引用来调用Web服务,并且已将日期字符串列表(收集日期)收集到公共类的数组列表中
public List DateList { get; 公共列表DateList { set;
组; }
}
I now want to load the dates into asp.net calendar so users can see what dates are available each month. 我现在想将日期加载到asp.net日历中,以便用户可以看到每个月可用的日期。
This should be simple but I am having trouble finding a way to do this? 这应该很简单,但是我很难找到一种方法来做到这一点? is it possible
可能吗
Are you looking to highlight some of the dates of the calendar control you may have a look at this . 您是否要突出显示日历控件的某些日期,您可能对此有所了解。 You can convert your list
public List DateList { get; set; }
您可以将列表转换为
public List DateList { get; set; }
public List DateList { get; set; }
public List DateList { get; set; }
to public static List<DateTime> list = new List<DateTime>();
public List DateList { get; set; }
到public static List<DateTime> list = new List<DateTime>();
and create a method that will render the control with the highlighted dates. 并创建一个将使用突出显示的日期呈现控件的方法。 This article provides the complete implementation here .
本文在此处提供完整的实现。 Sample code used in the article.
本文中使用的示例代码。
if (Session["SelectedDates"] != null) { List<DateTime> newList = (List<DateTime>)Session["SelectedDates"]; foreach (DateTime dt in newList) { Response.Write(dt.ToShortDateString() + "<BR/>"); } }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.