❔ Datepicker in ASP NET MVC 5 app
I'm trying to add datepicker in my app but It doesn't work
16 Replies
JQuery
Controller expects
userInput
in this case that will be the value from dateTime<input type="datetime-local" />
not good enough?
Ah, it's the old ASP? Some of the browsers you support probably won't support native date pickers, thenHmm
But how I will get that value from <input> to controller?
DateTime
type parameter?Can i somehow pass it to string?
My method is expecting string userInput
Im not passing this date to any object
Why do you even need it, then?
Because those are filter options
There is couple of options and some requires string input
And you filter by date... as a string
But wait
If I change string to dateTime
My datePicker should work?
Do i need to add some ID on that html tag you sent me?
¯\_(ツ)_/¯
Haven't used jQ in probably over a decade
No clue
And no, no id needed
A name however, yes
Then how tag will know where to be passed?
The name
Was about to say that you should generally prefer actual tags instead of
@Html
helpers on the first place, but then I was reminded you're using some dusty version of MVC, so ¯\_(ツ)_/¯
To be fair, I can't be 100% sure anything i say will work for you
It will work in modern versions, dunno how it was back in ye olde daysOkay thanks anyway
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.