I have a strongly typed view called News with a calendar control. I have defined the calendar's selectionchanged handler as follows:
<script runat="server">
void OnCalendarSelectionChanged(Object sender, EventArgs e)
{
var ndt = new Nullable<DateTime>(Calendar1.SelectedDate);
Html.RenderAction("ShowNews", new {dateTime = ndt });
}
</script>
In the controller, I have the following method:
public ActionResult ShowNews(Nullable<DateTime> dateTime)
{
IEnumerable<InvestmentNews> todaysNews = new List<InvestmentNews>(); ;
return View("News", todaysNews);
}
When I click on a date in my calendar, the Index() method in my controller is being invoked instead of ShowViews(). Can someone please explain what is happening?
TIA.