If you want to find out the number of days for "January",then pass the value 1 for Month parameter.
int numberOfDays = DateTime.DaysInMonth(Convert.ToInt32(YearList.SelectedItem.Value), Convert.ToInt32(MonthList.SelectedItem.Value))
int numberOfDays = DateTime.DaysInMonth(Convert.ToInt32(YearList.SelectedItem.Value), Convert.ToInt32(MonthList.SelectedItem.Value))
public DataTable GetLeaveAppliers()
{
using (SPSite site = new SPSite(SPContext.Current.Site.Url))
{
using (SPWeb web = site.OpenWeb())
{
SPList list = web.Lists["Leave Plan"];
SPQuery q = new SPQuery();
string query = " ";
q.Query=query;
DataTable dt = list.GetItems(q).GetDataTable();
DataTable row= dt.DefaultView.ToTable(true, "Author");
return row;
}
}
}
ClientContext cntx=new ClientContext("Site URL");
Web web = cntx.Current.Web;
List list=web.Lists.GetByTitle("List Name");
CamlQuery query=new CamlQuery();
query.ViewXML="";
ListItemCollection cols=list.GetItems(q);
cntx.Load(cols);
foreach(var item in cols)
{
list1.Items.Add(item["Title"]);
}
cntx.ExecuteQuery();
on my UserControl's on Click of the Button events I just simply placed an javascript alert.
this.Page.ClientScript.RegisterClientScriptBlock(Page.GetType(),"Greetings", "Type your script");You can set scope on your "Feature File"