小编dia*_*421的帖子

如何在 Asp.net MVC 中将两个文本框的值相乘

我有 3 个文本框,第一个是数量,第二个是价格,第三个是总价。

 <div class="form-group">
            @Html.LabelFor(model => model.quantity, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.quantity, new { htmlAttributes = new { @class = "form-control", @type = "number" } })
                @Html.ValidationMessageFor(model => model.quantity, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.price, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.price, new { htmlAttributes = new { @class = "form-control", @type = "number" } })
                @Html.ValidationMessageFor(model …
Run Code Online (Sandbox Code Playgroud)

c# asp.net asp.net-mvc-4

5
推荐指数
1
解决办法
3970
查看次数

使用方法“mysql_native_password”对用户“root”的主机“localhost”进行身份验证失败,并显示消息:未知数据库“xxx”

我在我的项目中使用代码优先方法。但是,当我尝试使用“update-database”命令运行 db-migrations 时,出现空引用异常,当我运行应用程序时,出现以下配置错误: Authentication to host 'localhost' for user 'root'使用方法“mysql_native_password”失败并显示消息:未知数据库“xxx”。

这是连接字符串:

 <add name="DefaultConnectionString" connectionString="server=localhost;port=3306;Database=cps;uid=root;pwd=root;" providerName="MySql.Data.MySqlClient" />
Run Code Online (Sandbox Code Playgroud)

PS:在其他系统上运行良好。

mysql asp.net mysql-workbench asp.net-web-api2

3
推荐指数
1
解决办法
7万
查看次数