locked
How to make work html inputs in included html in cshtml RRS feed

  • Question

  • User1052662409 posted

    Hi All,

    I am using MVC 5 with a small (a sub-module) angular app.

    I have a view index.cshtml. In this view, I have included a Menubar.html.

    <div ng-include="'../LocalizationAdmin/Partials/Menubar.html'"></div>
    

    All working fine without any issue.

    Now I want to add two inputs in that Menubar.html like below.

     <li>
                <input type="file" name="file" id="file" /><br><br>
                <input type="submit" value="Upload Excel" />
            </li>
            <li>
                <a ng-show="view.isLocalizationTable"
                   xng-click="view.onExportResxResourcesClick()"
                   data-toggle="modal" data-target="#ImportExportResxDialog"
                   title="{{::view.dbRes('ExportResx_Title')}}"
                   data-resource-id="ImportExportResx">
                    <i class="fa fa-download"></i> {{::view.dbRes('ImportExportResx')}}
                </a>
            </li>

    The control with id "ImportExportResx" showing on the page and working fin, but I am unable to find the below inputs on the page.

    <li>
                <input type="file" name="file" id="file" /><br><br>
                <input type="submit" value="Upload Excel" />
            </li>

    I want to call a index.cshtml's controllers ActionResult  by using the inputs.

    I am not aware of angular please suggest.

    Thanks

    Wednesday, July 1, 2020 9:12 AM

Answers

  • User-474980206 posted

    They are input included in the post data because they are outside the form. Just surround your input and submit button with a form. Set the ORM action to the url you want it to post to.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 1, 2020 2:25 PM