This is a migrated thread and some comments may be shown as answers.

MVC Controller not getting session value when entered via javascript.

3 Answers 189 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 21 Apr 2016, 06:11 PM

Hi -

I am using .Net MVC and have a custom editor template for the scheduler with a new textbox for MasterCatalogID.  The value gets set via javascript from button.  When I try to save the session, in the Controller method, I do not see the value for MasterCatalogID.

However, if I manually type in the value, I can get it in the Controller method.

Is there something else I need to add to retrieve the value?

 

<div class="k-edit-label">
    @(Html.LabelFor( model => model.MasterCatalogID, "Course" ))
</div>
<div data-container-for="MasterCatalogID" class="k-edit-field input-group">
    @(Html.TextBoxFor( model => model.MasterCatalogID, new { @class = "k-textbox" } ))
</div>

3 Answers, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 25 Apr 2016, 08:45 AM
Hi Joe,

Please attach sample project, so we can review your code?

Thanks.

Regards,
Hristo Valyavicharski
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Joe
Top achievements
Rank 1
answered on 25 Apr 2016, 04:16 PM

Hristo - 

Attached is the sample code.  I included a ReadMe file for the steps I have to reproduce the behavior.

Another question I have that you will where executing this is that it appears the CreateSchedule method in the Controller gets triggered for all the events in the Scheduler.

Thanks.
0
Joe
Top achievements
Rank 1
answered on 25 Apr 2016, 04:48 PM

I've found a solution.

If I call the change event on the textbox after setting the value, I can retrieve it in the Controller.

        $('\#CourseID').val(id);
        $('\#CourseID').change();

Tags
Scheduler
Asked by
Joe
Top achievements
Rank 1
Answers by
Hristo Valyavicharski
Telerik team
Joe
Top achievements
Rank 1
Share this question
or