Jquery mvc5 razor视图中带有单选按钮的css星级

Jquery mvc5 razor视图中带有单选按钮的css星级,jquery,html,css,asp.net-mvc,razor,Jquery,Html,Css,Asp.net Mvc,Razor,因此,我可以在表中创建一条记录。其中一种是由单选按钮1-7组成的评级 我想在我的视图中将我的表单组转换为基于该代码的css星级 这是我视图中我的表单组的代码 <div class="form-group"> @Html.LabelFor(model => model.Rating, htmlAttributes: new { @class = "control-label col-md-2" }) <div

因此,我可以在表中创建一条记录。其中一种是由单选按钮1-7组成的评级

我想在我的视图中将我的表单组转换为基于该代码的css星级

这是我视图中我的表单组的代码

<div class="form-group">
                @Html.LabelFor(model => model.Rating, htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.RadioButtonFor(model => model.Rating, "1")
                    @Html.RadioButtonFor(model => model.Rating, "2")
                    @Html.RadioButtonFor(model => model.Rating, "3")
                    @Html.RadioButtonFor(model => model.Rating, "4")
                    @Html.RadioButtonFor(model => model.Rating, "5")
                    @Html.RadioButtonFor(model => model.Rating, "6")
                    @Html.RadioButtonFor(model => model.Rating, "7")


                    @Html.ValidationMessageFor(model => model.Rating, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">

@LabelFor(model=>model.Rating,htmlAttributes:new{@class=“controllabel col-md-2”})
@Html.radioButton(model=>model.Rating,“1”)
@Html.radioButton(model=>model.Rating,“2”)
@Html.radioButton(model=>model.Rating,“3”)
@Html.radioButton(model=>model.Rating,“4”)
@Html.radioButton(model=>model.Rating,“5”)
@Html.radioButton(model=>model.Rating,“6”)
@Html.radioButton(model=>model.Rating,“7”)
@Html.ValidationMessageFor(model=>model.Rating,“,new{@class=“text danger”})

我需要在mvc5 html助手代码中转换html组件JSFIDLE中的代码,我不知道该如何做

那么问题出在哪里?你收到错误了吗?我需要在mvc5 html助手代码中转换html组件JSFIDLE中的代码,我不确定如何转换。你当前的代码(使用所需的css)将为单选按钮生成星星。什么不起作用?这不是什么不起作用的问题。我想了解如何将这5个设置为以下格式:@Html.LabelFor(model=>model.Rating,htmlAttributes:new{@class=“control label col-md-2”})@Html.radiobuttone(model=>model.Rating,“1”)
@Html.RadioButtonFor(model=>model.Rating,“1”,new{id=“Rating-1”})1
那么问题出在哪里?你收到错误了吗?我需要在mvc5 html助手代码中转换html组件JSFIDLE中的代码,我不确定如何转换。你当前的代码(使用所需的css)将为单选按钮生成星星。什么不起作用?这不是什么不起作用的问题。我想了解如何将这5个设置为以下格式:@Html.LabelFor(model=>model.Rating,htmlAttributes:new{@class=“control label col-md-2”})@Html.radiobuttone(model=>model.Rating,“1”)
@Html.RadioButtonFor(model=>model.Rating,“1”,new{id=“Rating-1”})1