I need sent system local datetime value to controller. I must use javascript for this but actionlinks listing Dynamically from database.
I try this but couldnt sent value to controller.
function getLocalTime (obj) {
debugger
var time = new Date();
var href = obj.getAttribute("href")
href = href + '/&&LocalTime=' + time.toLocaleTimeString();
this.href = href;
}
And It's my actionlink
@Html.ActionLink(item.Name, "Index", "Restaurants", New With { .aaaa= Model.aaaa,.bbbb= item.bbbb},New With{.onmouseover="getLocalTime(this);"})
How to sent local time value to controller ?
EDIT :
controller here;
Function Index(Optional ByVal aaaa As aaaa= Nothing, Optional ByVal bbbb As Integer = 0, Optional ByVal cccc As Integer = 0, Optional ByVal LocalTime As DateTime = Nothing) As ActionResult
Route Here ;
routes.MapRoute( _
name:="GetCitiesRestaurants", _
url:="Cities/SearchByCity/{aaaa}/{dddd}", _
defaults:=New With {.controller = "Cities", .action = "GetCitiesRestaurants", .aaaa= UrlParameter.Optional, .dddd= UrlParameter.Optional} _
)
I should hidden the varriables for privacy
