【问题标题】:Using Html.BeginForm and Semantic UI使用 Html.BeginForm 和语义 UI
【发布时间】:2016-11-01 10:32:18
【问题描述】:

当我使用Html.BeginForm 时,语义 UI 将运行并使用经典 UI。

如何解决这个问题?

@using (Html.BeginForm())
{
<div id="addRestaurant">
    <form class="ui form">
        <div class="required field">
            <label for="resName">Restaurant Name</label>
            <input type="text" name="model.RestaurantName" id="RestaurantName"/>
        </div>
...
</div>
}

使用 Html.BeginForm 之前

使用 Html.BeginForm 后

【问题讨论】:

    标签: css asp.net asp.net-mvc html-helper semantic-ui


    【解决方案1】:

    将类应用于mvc表单

    <div id="addRestaurant">
    @using (Html.BeginForm("ActionName","ControllerName", method: FormMethod.Post, htmlAttributes: new { @class="ui form"} )) {
    
            <div class="required field">
                <label for="resName">Restaurant Name</label>
                <input type="text" name="model.RestaurantName" id="RestaurantName"/>
            </div>
    ...
    
    }
    </div>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-27
      • 1970-01-01
      • 1970-01-01
      • 2017-05-06
      • 2016-08-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多