MVC Editor Templates

When you start working in the Back Office, we probably would like to overwrite the default behavior of our textbox, calendar, dropdown,geo location etc. By default all it’s all default textbox.

EditorTemplateMvc

<div id="@Html.FieldIdFor(model => model)">
    <div class="input-group" style="width: 150px;">
        <div class="spinner-buttons input-group-btn">
            <button type="button" class="btn spinner-up btn-warning">
                <i class="icon-plus"></i>
            </button>
        </div>
        @Html.TextBoxFor(model => model, new { @class = "spinner-input form-control" })
        <div class="spinner-buttons input-group-btn">
            <button type="button" class="btn spinner-down btn-danger">
                <i class="icon-minus"></i>
            </button>
        </div>
    </div>
</div>
<script type="text/javascript">
    $('#@Html.FieldIdFor(model => model)').spinner({ min: 0.0000, step: 0.1000 });
</script>

EditorTemplateMvcFinish

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s