How to convey a date, for example. 01/01/2011 21:01:34how is the query string?
I am creating a website for movie theater reservations, and while watching performances, I am currently broadcasting the show and the venue, but I must also transmit the date (as this is a unique part of the performance)
ActionResult looks like this:
public ActionResult Details(String name, String venue, String date)
{
return View(_repository.performanceDetails(name, venue, date));
}
But it performanceDatedoes not work, because it is a datetime data type! What I need to do is REMOVE the temporary part of the data, for example. 00:00:00and somehow pass the remaining data as a string, which I can use for comparison like this:
public PerformanceDetails performanceDetails(String name, String venue, String date)
{
var PerformanceDetails = (from s in _db.PerformanceDetails
where s.show == name &&
s.venue == venue &&
s.performanceDate == date
select s).First();
return PerformanceDetails;
}
Here is an example link:
<%= Html.ActionLink("View Details", "Details", "Performances",
new {
name = item.show,
venue = item.venue,
date = item.performanceDate },
new {@class = "button"}) %>
source
share