Search code examples
c#asp.netmetronic

Metronic with ASP.NET Core


Is there anyways to work ASP.NET with Metronic? For example:

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <link href="assets/plugins/global/plugins.bundle.css" rel="stylesheet" type="text/css"/>
    <script src="assets/plugins/global/plugins.bundle.js"></script>
    <form>
        <div class="container bg-primary">
            <label class="form-label">Basic example</label>
            <input class="form-control form-control-solid" placeholder="Pick date rage" id="kt_daterangepicker_1"/>
        </div>
    </form>
    <script>
        $("#kt_daterangepicker_1").daterangepicker({
            singleDatePicker: true
        });
    </script>
</asp:Content>

This code can be interpreted smoothly. However,

<input class="form-control form-control-solid" placeholder="Pick date rage" id="kt_daterangepicker_1" runat="server"/> 

when I add a runat="server" in order to retrieve the value of the input tag to process in cs file, the Metronic Data Range Picker does not function at all. Is there a way can mitigate this problem?

I tried with bootstrap but I'm having the same problem


Solution

  • Most probably you are running an ASP.NET web-form application. runat=server and ASP.NET WebForm Application is not supported in ASP.NET Core.