Telerik DatePicker - How to get value of control?

Please post public support tickets here. Note: for private support tickets, please send an email to support@cshtml5.com instead.
njs123
Posts: 25
Joined: Sun Dec 25, 2016 11:10 pm

Telerik DatePicker - How to get value of control?

Postby njs123 » Wed Jan 11, 2017 4:01 am

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);
            }
        }
Last edited by njs123 on Fri Jan 13, 2017 1:18 am, edited 1 time in total.

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: How to get value of control?

Postby JS-Support @Userware » Wed Jan 11, 2017 10:42 am

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

njs123
Posts: 25
Joined: Sun Dec 25, 2016 11:10 pm

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

Postby njs123 » Fri Jan 13, 2017 1:18 am

How to create the datepicker UI using CSHTML?

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

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

Postby JS-Support @Userware » Fri Jan 13, 2017 7:40 am

An example for the Kendo UI DatePicker is expected before the end of January.

Thanks.
Regards,
JS-Support


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 37 guests

 

 

cron