C
C#2y ago
XANDRO

❔ Datepicker in ASP NET MVC 5 app

I'm trying to add datepicker in my app but It doesn't work
16 Replies
XANDRO
XANDROOP2y ago
JQuery
XANDRO
XANDROOP2y ago
XANDRO
XANDROOP2y ago
Controller expects userInput in this case that will be the value from dateTime
Angius
Angius2y ago
<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, then
XANDRO
XANDROOP2y ago
Hmm But how I will get that value from <input> to controller?
Angius
Angius2y ago
DateTime type parameter?
XANDRO
XANDROOP2y ago
Can i somehow pass it to string? My method is expecting string userInput Im not passing this date to any object
Angius
Angius2y ago
Why do you even need it, then?
XANDRO
XANDROOP2y ago
Because those are filter options There is couple of options and some requires string input
Angius
Angius2y ago
And you filter by date... as a string
XANDRO
XANDROOP2y ago
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?
Angius
Angius2y ago
¯\_(ツ)_/¯ Haven't used jQ in probably over a decade No clue And no, no id needed A name however, yes
XANDRO
XANDROOP2y ago
Then how tag will know where to be passed?
Angius
Angius2y ago
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 days
XANDRO
XANDROOP2y ago
Okay thanks anyway
Accord
Accord2y ago
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.
Want results from more Discord servers?
Add your server