Hello all and thanks in advance for your help.
I am trying to create a calendar for each of my locations
I have added a field in my events database called location.
In Global.asax I added the following
routes.MapRoute(
“Receive”,
“Receive/{StoreNo}”,
new { controller = “Calendar”, action = “Index”,StoreNo = UrlParameter.Optional }
I am sending localhost/Receive/88 – for location 88
When I try and add an event and step thru it in C# I get null values for
" myevent.StoreNo = RouteData.Values[“StoreNo”].ToString(); "
code below
case “inserted”:
myevent = new Event();
myevent.start_date = DateTime.Parse(actionValues["start_date"]);
myevent.end_date = DateTime.Parse(actionValues["end_date"]);
myevent.Descrip = actionValues["text"];
myevent.StoreNo = RouteData.Values["StoreNo"].ToString(); //actionValues[RouteData.Values["StoreNo"].ToString()];//something is wrong here
data.Events.InsertOnSubmit(myevent);
break;
Is there an easier way to do this?