![](/img/trans.png)
[英]Window.Location.Href or other methods of redirecting _self not working (MVC View)
[英]_self is not working with a href
如果用户忘记密码,我正在制作一个带有链接的登录表单,该表单位于div内,如下所示,但是问题是,当用户单击“ Forgot the password
,它将在整个页面上而不是在div上打开此页面
<div>
<form class="form" method="POST" id="login-nav">
<div class="form-group">
<label for="emailaddress">Email address</label>
<input type="email" class="form-control" id="emailaddress" name="emailaddress"placeholder="Email address" required>
</div>
<div class="form-group">
<label for="pwd">Password</label>
<input type="password" class="form-control" id="pwd" name="pwd" placeholder="Password" required>
<div class="help-block text-right"><a href="forgotpassword.php">Forgot the password ?</a></div>
</div>
<div class="form-group">
<button type="submit" id="login_button" name="login_button" class="btn btn-primary btn-block">Sign in</button>
</div>
</form>
forgotpassword.php
<form action="" method="post">
<div class="form-group">
<label for="emailaddress">Enter your email address</label>
<input type="email" class="form-control" id="recovery_email" name="recovery_email" placeholder="Enter your email" required>
</div>
<div class="form-group">
<button type="submit" id="resetpassword" name="resetpassword" class="btn btn-primary btn-block">Reset Password</button>
</div>
_self是目标标签的标准配置。 它将在您所描述的同一个浏览器窗口中打开链接。 DIV不是iFrame。 (没有人想要iFrame这样的东西。真的。)
您必须再次在forgotpassword.php中构建div结构。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.