返回带有特定选项卡的视图

时间:2018-12-21 03:16:35

标签: asp.net-mvc tabs

我有问题。我有2个标签:“首页”和“登录”。当您进入登录选项卡,但登录失败时,它应该返回到视图登录选项卡。我该怎么办?

这是我的cshtml代码:

<body id="LoginForm">
    <div class="container">
        <div class="login-form">
            <div class="main-div">
                <ul class="nav nav-tabs" id="tabs">

                    <li class="active"><a data-toggle="tab" href="#firsttab">Home</a></li>
                    <li><a data-toggle="tab" href="#secondtab">Login</a></li>
                </ul>
                <div class="tab-content">
                    <div id="firsttab" class="tab-pane fade in active">tab buat Scan QRCOde</div>
                    <div id="secondtab" class="tab-pane fade in">
                        <div class="panel">
                            <h2>~~ Login Here! ~~</h2>

                            <label class="field-validation-error">@Html.DisplayFor(model => model.LoginErrorMessage)</label>
                        </div>
                        @using (Html.BeginForm("Autherize", "Login", FormMethod.Post))
                        {

                            <form id="Login">
                                <div class="form-group">
                                    @Html.EditorFor(model => model.username, new { htmlAttributes = new { @class = "form-control", @placeholder = "username" } })
                                    <div class="warna">@Html.ValidationMessageFor(model => model.username)</div>

                                </div>
                                <div class="form-group">
                                    @Html.EditorFor(model => model.password, new { htmlAttributes = new { @class = "form-control", @placeholder = "password" } })
                                    @Html.ValidationMessageFor(model => model.password)

                                </div>

                                <div class="button">
                                    <button type="submit" class="btn btn-primary" name="name">Login</button>

                                </div>
                            </form>
                        }
                    </div>
                </div>
            </div>

        </div>
    </div>

    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
</body>
</html>

0 个答案:

没有答案