c# - Setting DefaultValue to first and last date of current month -
how can set defaultvalue
's in following code start date (first controlparameter) , last date (second controlparameter) of current month?
<selectparameters> <asp:controlparameter controlid="txtfromdate" name="expensedate" propertyname="text" type="string" defaultvalue="01-05-2013" convertemptystringtonull="true" /> <asp:controlparameter controlid="txttodate" name="expensedate2" propertyname="text" type="string" defaultvalue="30-05-2013" convertemptystringtonull="true" /> </selectparameters>
datetime today = datetime.today; int daysinmonth = datetime.daysinmonth(today.year, today.month); datetime startofmonth = new datetime(today.year, today.month, 1); datetime endofmonth = new datetime(today.year, today.month, daysinmonth);
then can set these values controls.
Comments
Post a Comment