Page 1 of 1

Telerik DatePicker - How to get value of control?

Posted: Wed Jan 11, 2017 4:01 am
by njs123
Hi,

We are trying to create telerik rad datepicker like functionality using kendoui and cshtml, however value of html input fox is not getting retrieved.

How do I use datepicker in CSHTML5?

How do I get value of control using cshtml?

e.g. I have wrote following code but it does not return value

Code: Select all

        public string Value
        {
            get
            {
                //var ctrl = "#" + ID;
                var ctrlValue = CSHTML5.Interop.ExecuteJavaScript(@"jQuery('.datetimepicker').val();");
                return Convert.ToString(ctrlValue);
            }
        }

Re: How to get value of control?

Posted: Wed Jan 11, 2017 10:42 am
by JS-Support @Userware
Hi,

Your code should work fine.

To debug, please:
1) launch your application in Chrome
2) then open the Chrome Developer Tools (Ctrl+Shift+I or F12)
3) click "Sources"
4) open the file "YourApp.js" (where "YourApp" is the name of your project)
5) go to the line that contains "jQuery('.datetimepicker').val"
6) place a breakpoint there
7) relaunch the app by pressing F5 and step into your code

Thanks,
Regards,
JS-Support

Re: Telerik DatePicker - How to get value of control?

Posted: Fri Jan 13, 2017 1:18 am
by njs123
How to create the datepicker UI using CSHTML?

Re: Telerik DatePicker - How to get value of control?

Posted: Fri Jan 13, 2017 7:40 am
by JS-Support @Userware
An example for the Kendo UI DatePicker is expected before the end of January.

Thanks.
Regards,
JS-Support