@{ 
    CurrentUser currentUser = ViewBag.CurrentUser;
    int uid = currentUser.Uid;
}
<div class="current-location">
    <ul>
        <li class="left"><i class="glyphicon glyphicon-home"></i><a href="javascript:void(0)" onclick="location.href=location.href">修改用户名</a></li>
    </ul>
</div>
<div class="main">
    <form method="post" id="_form" class="form form-control-sm ui-validForm" style="max-width:720px">
        <div class="form-group">
            <label class="control-label">当前用户名</label>
            <div class="controls">
                <p class="form-control-static">@currentUser.UserName</p>
                <span class="help-block"></span>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label">新用户名</label>
                <div class="controls ">
                    <input type="text" id="username" name="username" class="form-control" maxlength="15" placeholder="用户名" v-validate="dataType:'username',nullMsg:'请填写新用户名',errorMsg:''">
                    <span class="help-block"></span>
                </div>
        </div>

        <div class="postarea">
            <div class="form-group">
                <div class="controls">
                    <input type="hidden" id="Id" name="Id" value="@uid" />
                    <button type="button" class="btn btn-sm  btn-primary ui-pagePost" data-custom-params="url:'@Url.ActionUrl()',callback:'PostBack'">提交</button>
                    <a href="@Url.ActionUrl("Security")" class="btn btn-sm btn-default btn-back">返回</a>
                </div>
            </div>
        </div>
    </form>
</div>

<script type="text/javascript">
    function PostBack() {
        Alert("用户名成功!", { icon: 1 }, function () { location.href='@Url.ActionUrl("Security")'})
    }
</script>
