Hi @piglet ,
The problem is the datetime information can not be retrieved every time.
What means can not be retrieved every time? Do you get the value occasionally, but not every so often? As far as I think, the code behind can't get the value from the js datetimepicker. I suggest you could get the value using js and then use ajax to post to the code behind.
js like this:
code-behind:
[WebMethod]
public static string Test(string tb)
{
DateTime endDate = Convert.ToDateTime(tb);
int result = shiftController.UploadShift(endDate);
return result.ToString();
}
Best regards,
Yijing Sun
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.