Hi!!
I have a page that highly depends on a IList (in ActionResult "MyEvents") that I pass in ViewData. Something like that: ViewData["events"] = listOfEvents; and in the end, I just return View();
And in my View, I take this ViewData["events"] and do a foreach in it so I can iterate through its contents.
But, this ViewData must be dynamically filled. So, when I click on a day (I'm using jQuery DatePicker), this day is sent as an argument to "MyEvents" and this day will be very important to my listOfEvents that will fill my ViewData["events"].
But, the result I'm getting is that the div that contains my foreach creates another whole page inside it!! I've tried to do $("#myDiv").html(contentFromMyEvents) and this was what happened.
Just for testing, I've tried also to do $("#myDiv").text(contentFromMyEvents) and the whole html code with all its tags and everyting else from my page appeared inside the div! It was a page inside a page!!
So, I think that is happening because I'm returning "return View();" and of course it will render my whole View again.
So, how can I pass just the ViewData["events"] and update it on my page??
Thanks!!