css - Bootstrap 3弹出透明和样式问题?
问题描述
我正在开发一个带有数据表、引导程序、ajax 和 asp.net mvc 的调查应用程序。在这个投票应用程序中,我使用引导程序打开一个弹出窗口以添加投票并从此处添加和更新。但是我在弹出窗口时遇到了问题。而且我找不到问题的根源。弹出的弹出窗口没有以我想要的方式显示字段。例如,弹出窗口的背景看起来是透明的。可能是什么问题。我正在使用 Bootstrap 4 javascript 和 bootstrap 3 css。你会说为什么如果我将 bootstrap 4 用于 css 屏幕会完全损坏的版本。我正在添加相关的代码块。我很好奇你的评论和评价。
创建的弹出窗口的图像 弹出图像
弹出视图
@model MerinosSurvey.Models.Surveys
@{
Layout = null;
}
@using (Html.BeginForm("AddOrEdit", "Survey", FormMethod.Post, new { onsubmit = "return
SubmitForm(this)" }))
{
@Html.HiddenFor(model => model.SurveyId)
<div class="form-group">
@Html.LabelFor(model => model.SurveyName, new { @class = "control-label" })
@Html.EditorFor(model => model.SurveyName, new { htmlAttributes = new { @class = "form-control"
} })
@Html.ValidationMessageFor(model => model.SurveyName)
</div>
<div class="form-group">
@Html.LabelFor(model => model.SurveyDescription, new { @class = "control-label" })
@Html.EditorFor(model => model.SurveyDescription, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.SurveyDescription)
</div>
<div class="form-group">
<input type="submit" value="Submit" class="btn btn-primary" />
<input type="reset" value="Reset" class="btn" />
</div>
}
弹出窗口并提交
function PopupForm(url) {
var formDiv = $('<div/>');
$.get(url)
.done(function (response) {
formDiv.html(response);
Popup = formDiv.dialog({
autoOpen: true,
resizable: true,
title: 'Fill Survey Details',
height: 500,
width: 700,
close: function () {
Popup.dialog('destroy').remove();
}
});
});
}
function SubmitForm(form) {
$.validator.unobtrusive.parse(form);
if ($(form).valid()) {
$.ajax({
type: "POST",
url: form.action,
data: $(form).serialize(),
success: function (data) {
if (data.success) {
Popup.dialog('close');
dataTable.ajax.reload();
$.notify(data.message,
{
globalPosition: "top center",
className: "success"
});
}
}
});
}
return false;
}
解决方案
我将 Bootstrap css 和 javascript 版本更改为 4,并对 layout.cshtml 进行了更改。问题解决了。这是我参考的来源。参考链接。但我有一个小问题。弹出的关闭按钮有图标问题。我要解决这个问题。
推荐阅读
- powershell - invoke-sqlcmd 的 Powershell 进度条
- activiti - Activiti 6:在加入两个并行任务时,带有 Async Executor 的并行网关不工作
- javascript - 为什么我的 JS 代码在调用 JS 函数 showSlides(SLIDEINDEX) 时没有显示任何其他幻灯片;即使我改变了 SLIDEINDEX 的值?
- reactjs - react redux - 将数据向下传递多个级别
- python - selenium.common.exceptions.WebDriverException:消息:未知错误:通过 InstaPy 和 selenium 测试执行时无法发现打开的页面
- python - 如何根据 HTML 通过 Selenium 和 Python 将文本发送到文本区域
- java - 如果在 Maven 插件 Tomcat 7 上运行,为什么不能在 Tomcat 8 上运行 Java Web 应用程序?
- php - 证书 x509 Laravel 身份验证 SSL
- python - 稍后使用 OpenCV 到 OCR 减少文本(驾驶执照)中的大量噪音?
- java - 面临与休眠“javax.persistence.TransactionRequiredException”相关的问题