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.

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

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

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

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

    I am not aware of angular please suggest.


    Wednesday, July 1, 2020 9:12 AM


  • 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