Hi comunidadmexi...,
Refer below code.
Model
public class PersonModel
{
public bool Breakfast { get; set; }
}
Controller
public class HomeController : Controller
{
// GET: Home
public ActionResult Index()
{
return View();
}
public ActionResult IndexP()
{
return View();
}
}
View
Index
@model Open_Tab_MVC.Models.PersonModel
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$("[id*=Breakfast]").click(function () {
if ($(this).is(':checked')) {
window.open('/Home/IndexP', '_blank');
}
});
});
</script>
</head>
<body>
<div class="row">
<div class="col-md-12">
<div class="form-group" style="background-color: darkorange; border:3px solid; font-weight:bold;">
<h5 style="font-weight: bold;"> Breakfast: @Html.CheckBoxFor(m => m.Breakfast, true) </h5>
</div>
</div>
</div>
</body>
</html>
IndexP
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>IndexP</title>
</head>
<body>
<div>
</div>
</body>
</html>
Screenshot