Question

I am new to Kendo and I am having a very hard time trying to do this. I followed this demo. here and got it to work up the part that I wanted to have a text box and a send button in the window modal that the user would have to fill in and click send.

I am able to use Ajax to make the call to my controller but I can't get the information in the modal window to pass to the controller via FormCollection. Here's my window modal template:

<script type="text/x-kendo-template" id="template">                      
<div id="details-container">  
    <h5 data-idtest="1">#= Id #</h5>                       
    <h2>#= TitleDisplay # - #= ArtistDisplay #</h2>        
    Input The Day:<input id="TheDayTextBox" name="TheDay" type="text" />

    @using (Ajax.BeginForm("TheAction", "Search", new AjaxOptions { UpdateTargetId = "#=Id" }))
    {
        <button class="btn btn-inversea" title="Log outa" type="submit">Log Offsdfsaf</button>
    }

</div>

Controller: public ActionResult TheAction(string id, FormCollection form) { .... }

So how does Kendo pass data to controller inside a modal?

Was it helpful?

Solution

Try putting your input inside of the actual form:

<script type="text/x-kendo-template" id="template">                      
<div id="details-container">  
<h5 data-idtest="1">#= Id #</h5>                       
<h2>#= TitleDisplay # - #= ArtistDisplay #</h2>        


@using (Ajax.BeginForm("TheAction", "Search", new AjaxOptions { UpdateTargetId = "#=Id" }))
{
    Input The Day:<input id="TheDayTextBox" name="TheDay" type="text" />
    <button class="btn btn-inversea" title="Log outa" type="submit">Log Offsdfsaf</button>
}

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top