gpt4 book ai didi

html - 为什么我的模态不工作不显示,我想把它发送到代码后面

转载 作者:行者123 更新时间:2023-11-28 00:40:27 25 4
gpt4 key购买 nike

我的模式不工作。实际上我想要一个模式来注册并将它发送到我的页面后面的代码。我使用过 bootstrap lumen 和 jquery。请帮助我,任何帮助都是有益的。提前致谢。

我还需要制作一个表单并为此生成 ajax 调用。

screenshot

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="HotelReservation.Views.Login" %>
<!DOCTYPE html>
<link href="../css/bootstrap.css" rel="stylesheet" />
<script src="../js/bootstrap.js"></script>
<link href="../css/bootstrap.min.css" rel="stylesheet" />
<script src="../js/bootstrap.min.js"></script>
<link href="../css/custom1.css" rel="stylesheet" />
<script src="../js/jquery-3.3.1.min.js"></script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>

<div class="container">
<div class="row">
<div class="form_bg">
<form>
<h2 class="text-center">Login Page</h2>
<br />
<div class="form-group">
<input type="email" class="form-control" id="userid" placeholder="User id">
</div>
<div class="form-group">
<input type="password" class="form-control" id="pwd" placeholder="Password">
</div>
<br />
<div class="align-center">
<button type="submit" class="btn btn-default" id="login">Login</button>
</div>
<br />
<button class="btn btn-success" data-toggle="modal" data-target="#mymodal">Launch Modal </button>
<div class="modal">
<div class="modal-dialog" role="document" id="mymodal">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p>Modal body text goes here.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary">Save changes</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</form>

</div>
</div>
</div>
</body>
</html>

最佳答案

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="HotelReservation.Views.Login" %>    
<!DOCTYPE html>

<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<link href="../css/custom1.css" rel="stylesheet" />

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>

<body>
<div class="container">
<div class="row">
<div class="form_bg">
<form>
<h2 class="text-center">Login Page</h2>
<br />
<div class="form-group">
<input
type="email"
class="form-control"
id="userid"
placeholder="User id"
/>
</div>
<div class="form-group">
<input
type="password"
class="form-control"
id="pwd"
placeholder="Password"
/>
</div>
<br />
<div class="align-center">
<button type="submit" class="btn btn-default" id="login">
Login
</button>
</div>
<br />
<div
class="btn btn-success"
data-toggle="modal"
data-target="#mymodal"
>
Launch Modal
</div>
<div class="modal">
<div class="modal-dialog" role="document" id="mymodal">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Modal title</h5>
<button
type="button"
class="close"
data-dismiss="modal"
aria-label="Close"
>
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p>Modal body text goes here.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary">
Save changes
</button>
<button
type="button"
class="btn btn-secondary"
data-dismiss="modal"
>
Close
</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>

<script>
$(document).ready(function() {
$(".btn-success").click(function() {
console.log("hit");
$(".modal").modal("show");
});
});
</script>
</body>
</html>

关于html - 为什么我的模态不工作不显示,我想把它发送到代码后面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53799420/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com