怎么制作有效网站wordpress鼠标导航栏

diannao/2026/1/27 0:10:26/文章来源:
怎么制作有效网站,wordpress鼠标导航栏,动漫设计公司,建网站免费域名目录 一、建立项目 二、删除无用文件 三、样式添加 四、写一个登录页面 五、登录主界面 一、建立项目 二、删除无用文件 三、样式添加 将你的图片资源添加在wwwroot下方#xff0c;例如pics/logo.png 四、写一个登录页面 将Privacy.cshtml改为 Forget.cshtml #xff0…目录 一、建立项目 二、删除无用文件 三、样式添加 四、写一个登录页面 五、登录主界面 一、建立项目 二、删除无用文件 三、样式添加 将你的图片资源添加在wwwroot下方例如pics/logo.png 四、写一个登录页面 将Privacy.cshtml改为 Forget.cshtml 并且在HomeController中的方法也改一下 public IActionResult Forget() //点击密码时返回视图 {return View(); } 并且在 Forget.cshtml 写下如下代码 h1忘记密码页面/h1 然后在Index.cshtml中写下如下代码 !DOCTYPE html html langen headmeta charsetUTF-8meta nameviewport contentwidthdevice-width, initial-scale1.0title登录页面/title!-- Bootstrap CSS --link relstylesheet hrefhttps://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css!-- Custom styles --stylebody {background-color: #f8f9fa;font-size: 20px;}.login-container {display: flex;justify-content: center;align-items: center;height: 100vh;}.login-form {max-width: 400px;padding: 35px;background-color: #fff;border-radius: 10px;box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1);}.login-form h2 {text-align: center;margin-bottom: 40px;}.form-group label {font-size: 22px;}.form-control {height: 40px;font-size: 18px;margin-bottom: 20px; /* 增加文本框的下间距 */}.form-actions {display: flex; /* 设置为 Flex 容器 */justify-content: flex-end; /* 将子元素对齐到容器的末尾 */align-items: center; /* 垂直居中子元素 */margin-top: 1rem; /* 添加一些上边距以与表单字段分隔 */}.btn {/* 确保按钮和链接看起来相似根据需要调整样式 */padding: 0.5rem 1rem;color: white;background-color: #007bff;border: none;border-radius: 0.25rem;cursor: pointer;margin:20px;}.btn:hover {background-color: #0056b3; /* 悬停效果 */}.logo {width: 120px;height: auto;display: block;margin: 0 auto;margin-bottom: 30px;}/style /head bodydiv classlogin-containerdiv classlogin-formimg src/pics/logo.png altLogo classlogoh2XXX管理系统/h2form methodpost action/Home/Indexdiv classform-grouplabel forusername账号 /labelinput typetext classform-control idusername placeholder请输入您的帐号 Nameid /divdiv classform-grouplabel forpassword密码 /labelinput typepassword classform-control idpassword placeholder请输入您的密码 Namepwd/divdiv classform-actions!-- 创建一个新的 div 作为 Flex 容器 --button typesubmit classbtn登录/buttonbutton typesubmit classbtn onclickwindow.open(/Home/Forget)忘记密码/button/div/form/div/div!-- Bootstrap JS --script srchttps://code.jquery.com/jquery-3.5.1.slim.min.js/scriptscript srchttps://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js/script/body /html再创建一个控制器和界面MainController 和 Main/Index  伪后端 HomeController public static bool Loginflag false;[HttpPost] public IActionResult Index(string id,string pwd) {if (pwd!null pwd.Equals(123)){Loginflag true;return RedirectToAction(Index, Main);//重定向到MainController下的Index界面}else{return View();} } 伪后端 MainController public IActionResult Index() {if(HomeController.Loginflag)//如果登录成功{return View();//打开当前界面}else{return RedirectToAction(Index,Home);//重定向到HomeController下的Index界面} } 效果密码输入为123时登录成功点击忘记密码会跳转到忘记密码页面。 【更好的传入方式】封装成一个类传入 五、登录主界面 伪后端 MainController using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using WebApplication1.Models;namespace WebApplication1.Controllers {public class MainController : Controller{public IActionResult Index(int? page, QueryParameters? parametersnull)//QueryParameters类需要自主创建{if(HomeController.Loginflag)//如果登录成功{//默认用户名ViewBag.UserName 小明;// 获取输入框的查询数据string name parameters?.Name;string className parameters?.ClassName;int? age parameters?.Age;string gender parameters?.Gender;bool? under18 parameters?.Under18;#region 模拟数据库查询var list new ListStudent();list.Add(new Student { Id1,Name小虹,age18,sex女,classes计算机1班});list.Add(new Student { Id 2, Name 小明, age 19, sex 男, classes 计算机2班 });list.Add(new Student { Id 3, Name 小华, age 17, sex 女, classes 计算机3班 });list.Add(new Student { Id 4, Name 小张, age 20, sex 男, classes 数学1班 });list.Add(new Student { Id 5, Name 小李, age 18, sex 女, classes 物理2班 });list.Add(new Student { Id 6, Name 小王, age 19, sex 男, classes 化学3班 });list.Add(new Student { Id 7, Name 小赵, age 21, sex 女, classes 生物1班 });list.Add(new Student { Id 8, Name 小陈, age 17, sex 男, classes 英语2班 });list.Add(new Student { Id 9, Name 小刘, age 18, sex 女, classes 历史3班 });list.Add(new Student { Id 10, Name 小周, age 19, sex 男, classes 地理1班 });list.Add(new Student { Id 11, Name 小吴, age 20, sex 女, classes 政治2班 });list.Add(new Student { Id 12, Name 小郑, age 17, sex 男, classes 语文3班 });list.Add(new Student { Id 13, Name 小孙, age 18, sex 女, classes 美术1班 });list.Add(new Student { Id 14, Name 小袁, age 19, sex 男, classes 音乐2班 });list.Add(new Student { Id 15, Name 小许, age 20, sex 女, classes 体育3班 });list.Add(new Student { Id 16, Name 小徐, age 21, sex 男, classes 信息1班 });#endregionint pageSize 10; // 每页显示的数据量int pageNumber (page ?? 1); // 当前页数默认为第一页ViewBag.CurrentPage pageNumber;ViewBag.TotalPages (int)Math.Ceiling((double)list.Count / pageSize); // 计算总页数ViewBag.ResultList list.Skip((pageNumber - 1) * pageSize).Take(pageSize).ToList(); ;return View();//打开当前界面}else{return RedirectToAction(Index,Home);//重定向到HomeController下的Index界面}}/// summary/// 点击修改按钮/// /summary/// param namedata/param/// returns/returns[HttpPost]public IActionResult Index([FromBody] RetunData data)//RetunData类需要自主创建{int id data.Id;return Ok(); // 返回成功响应}} }Main/Index界面 !DOCTYPE html html headtitle导航栏示例/titlestylebody {margin: 0;padding: 0;}.navbar {background-color: #007bff;color: white;padding: 10px;margin: 0;width: 100%;box-sizing: border-box;}.navbar-items {list-style-type: none;padding: 0;margin: 0;width:200px;background-color: ghostwhite; /* 您可以根据需要更改背景颜色 */}.navbar-items li {display: block; /* 设置为块级元素使它们竖着排列 */padding: 10px;}.navbar-items li:hover {background-color: #ddd; /* 鼠标悬停时的背景颜色 */cursor: pointer; /* 鼠标悬停时变为手形图标 */}th, td {border: 1px solid #dddddd;text-align: left;padding: 8px;}tr:nth-child(even) {background-color: #f2f2f2;}/style /head bodydiv classnavbar欢迎您ViewBag.UserName/divul classnavbar-items styletext-align: center;lia href# stylecolor: inherit; text-decoration: none;项目1/a/lilia href# stylecolor: inherit; text-decoration: none;项目2/a/lilia href# stylecolor: inherit; text-decoration: none;项目3/a/lilia href# stylecolor: inherit; text-decoration: none;项目4/a/lilia href# stylecolor: inherit; text-decoration: none;项目5/a/li/uldiv styletext-align: center; position: absolute; left:350px; top:70px;input typetext idnameInput placeholder姓名 stylemargin:10pxinput typetext idclassInput placeholder班级 stylemargin:10pxinput typetext idageInput placeholder年龄 stylemargin:10pxselect idgenderSelect stylemargin:10pxoption value男男/optionoption value女女/option/selectinput typecheckbox idunder18Checkbox stylemargin:10px 小于18岁button idrefreshButton typebutton stylebackground-color: greenyellow; border: none; padding: 5px 10px; cursor: pointer;刷新查询/buttonbutton typebutton stylebackground-color: cornflowerblue; border: none; padding: 5px 10px; cursor: pointer;新增信息/button/div!-- 列表 --table stylemargin: 20px auto;border-collapse: collapse; position: absolute;left:550px; top:130px;theadtr stylemargin: 20px auto;th姓名/thth班级/thth年龄/thth性别/thth操作/th/tr/theadtbodyforeach (var item in ViewBag.ResultList){trtditem.Name/tdtditem.classes/tdtditem.age/tdtditem.sex/td!-- 继续添加更多字段 --tdbutton typebutton stylebackground-color: orange; border: none; padding: 5px 10px; cursor: pointer; onclickmodifyRecord(item.Id)修改/buttonbutton typebutton stylebackground-color: #dc143c; border: none; padding: 5px 10px; cursor: pointer;删除/button/td/tr}/tbody/table!-- 上一页/下一页按钮以及页码 --div classpagination styletext-align: center; position: absolute;left:600px; top:650px; margin:5pxbutton typebutton onclicklocation.hrefUrl.Action(Index, new { page ViewBag.CurrentPage - 1 }) (ViewBag.CurrentPage 1 ? disabled : )上一页/buttonspan第 ViewBag.CurrentPage 页/共 ViewBag.TotalPages 页 /spanbutton typebutton onclicklocation.hrefUrl.Action(Index, new { page ViewBag.CurrentPage 1 }) (ViewBag.CurrentPage ViewBag.TotalPages ? disabled : )下一页/button/divscript srchttps://code.jquery.com/jquery-3.6.0.min.js/scriptscript// 监听按钮点击事件$(#refreshButton).on(click, function () {// 获取输入框和选择框的值var name $(#nameInput).val();var className $(#classInput).val();var age $(#ageInput).val();var gender $(#genderSelect).val();var under18 $(#under18Checkbox).is(:checked);// 发送Ajax请求$.ajax({url: /Main/Index, // 后端处理方法的URLmethod: GET, // 使用GET方法发送请求data: {name: name,className: className,age: age,gender: gender,under18: under18},success: function (response) {// 请求成功后的处理逻辑console.log(后端处理成功);},error: function (xhr, status, error) {// 请求失败后的处理逻辑console.error(后端处理失败:, error);}});});function modifyRecord(id) {// 创建一个包含ID的对象POST请求的特点var data { id: id };// 发送POST请求$.ajax({url: /Main/Index, // 根据你的实际路由进行修改type: POST,contentType: application/json,data: JSON.stringify(data),success: function (response) {// 处理成功响应console.log(Record modified successfully);},error: function (xhr, status, error) {// 处理错误响应console.error(Error modifying record:, error);}});}/script /body /html 【效果如下所示】 当然这只是个demo很多功能都没有实现只是写一下前端以及前后端是如何交互的。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/87795.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

网站上有什么作用WordPress富媒体说说

问题描述 Request请求之后,页面返回了数据,其他字段都对,就那一个字段是null 排除问题 能访问到其他数据,说明IDEA连接数据库时成功了的,那不是数据库的问题就是字段本身的问题 存在的问题 字段类型,检…

优秀网站的要素有福田市网站建设推广

1.前言 在9.0的系统rom产品定制化开发中,在对于第三方app全屏显示的功能需求开发中,需要默认app全屏显示,针对这一个要求,就需要在系统启动app 的过程中,在绘制app阶段就设置全屏属性,接下来就实现这个功能 效果图如下: 2.framework层实现app默认全屏显示的核心类 fram…

网站改版的费用建设工程公司简介

叶梓,工学博士,高级工程师。现某大型上市企业资深技术专家。 2005年上海交通大学计算机专业博士毕业,在校期间的主研方向为数据挖掘、机器学习、人工智能。毕业后即进入软件行业从事信息化技术相关工作;负责或参与了多项国家级、省…

做网站要服务器和什么wordpress 图片浏览器

有一段时间没有写文章,techempower的测试规则评分竟然发生了变化,只能忘着补充一下占比权重最多的数据更新示例了和深入设计一下组件模块化加载的设计。但在不久前有用户问了一下组件是否支持redis的Stream功能,看了一样相关资料后把功能实现…

网站原型设计软件开发做平台

List,Set,Map,有什么区别? List和Set实际上市实现了Collection接口,那么Collection接口的原理你能简单描述一下吗? List接口可以插入多个NULL值,并且重复值,而且LIST是一个有序的集合。 Set是一个不可重复的集合&#…

搜索网站 模板可以用手机制作app的软件

在系统的相册中,观看相片就可以用多个手指进行缩放.要实现这个功能,只需要这几步:1.新建项目,在项目中新建一个ZoomImage.javapublic class ZoomImageView extends View {//初始化状态常量public static final int STATUS_INIT1;//图片放大状态常量public static final int STA…

网站交互界面国内html5网站案例

文章目录 结构优缺点优点缺点使用了迭代器模式的知名框架代码示例在实现迭代器时,需要有什么考虑迭代器模式(Iterator)是一种行为设计模式,它允许在不暴露集合底层表示的情况下,顺序访问一个集合中的元素。这种模式在需要逐个处理集合中的元素,而又不希望暴露其内部结构的…

写出网站开发的基本流程做网站需要做优化吗

文章目录1 问题描述2 问题分析3 代码实现1 问题描述 有读者和写者两组并发进程,共享一个文件,当两个或两个以上的读进程同时访问共享数据时不会产生副作用,但若某个写进程和其他进程(读进程或写进程)同时访问共享数据时…

淘宝客如何建立自己的网站建设商城网站的难点

思路:因为题目说只要存在组ai??ai??n??ai??2n?≠?6就令人满意,也就是不满意的情况就是所有ai??ai??n??ai??2n?都等于6那就用所有的情况减去不满意的情况,总结: 直接用二分幂不知道为什么wa的要死,看到别人的题…

潍坊在线制作网站网站推广软件费用是多少

最大子矩阵...悬线法..时间复杂度O(nm)悬线法就是记录一个H向上延伸的最大长度(悬线), L, R向左向右延伸的最大长度, 然后通过递推来得到. ------------------------------------------------------------------#include<bits/stdc.h>using namespace std;#define ok(c) …

有可以做推广的网站吗网站设计欣赏移动

今天是三八女神节&#xff0c;这里先祝广大的程序员妹子们节日快乐&#xff0c;健康美丽&#xff01;有一个问题&#xff0c;相信很多.NET程序员都很感兴趣&#xff1a;.NET程序员中女生占比多少&#xff1f;先来公布答案&#xff1a;在本次调查中发现&#xff0c;.NET程序员群…

新丰县建设局网站模板 网站 缺点

js 一直允许定义类。ES6新增了相关语法(包括class关键字)让创建类更容易。新语法创建的类和老式的类原理相同。js 的类和基于原型的继承机制与Java等语言中的类和继承机制有着本质区别。 1 类和原型 类意味着一组对象从同一个原型对象继承属性。因此&#xff0c;原型对象是…

修改wordpress地址网站打不开哪里有专做水果的网站

在 Lua 中&#xff0c;性能分析&#xff08;profiling&#xff09;是一个关键步骤&#xff0c;用于找出代码中的瓶颈和优化机会。通过性能分析&#xff0c;你可以了解哪些函数或代码段占用了最多的执行时间&#xff0c;从而可以优先优化这些部分。 Lua 本身并没有内置的性能分…

中建建筑网站海南政务网

2024网盘行业再次重燃战火。字节旗下产品头条搜索极速版APP、悟空浏览器APP推出对应的网盘功能&#xff0c;刚刚开放了拉新推广&#xff0c;现在是一个不能错过新项目的好时机。 如果你对网盘拉新推广充满热情&#xff0c;千万不要错过星子助推联合字节推出的网盘项目机会。小…

中国建设机械教育网官方网站网站编程图

随着人口老龄化的加剧&#xff0c;智慧养老成为了社会关注的焦点。智慧养老小程序作为一种便捷、高效的服务工具&#xff0c;为老年人提供了更全面、个性化的服务。本文将介绍如何使用JAVA编程语言开发一款同城服务智慧养老小程序。 一、设计思路 界面设计&#xff1a;小程序…

网站权限设计深圳出台鼓励芯片产业政策

用该命令sed删除文件test.txt中包含某个字符串abc的行: sed /adc/d test.txt >result.txt 在文件test.txt中删除从开头到含有某个字符串abc的行 sed 1,/abc/d test.txt >result.txt 获取文件test.txt中包含字符串abc的行 cat test.txt |grep "abc" > resul…

地方网站怎么做挣钱网站开发案例详解 源代码

随着 Visual Studio Code 1.59.0 正式版本的发布&#xff0c;全新的插件测试 API 也从试验版本进入了正式版本。自 2020 年 9 月起至今&#xff0c;经过了将近一年及数次版本迭代的打磨&#xff0c;不管是 API 的功能性还是易用性&#xff0c;与首个预览版本相比都获得了极大的…

怎么个人网站设计网站建设app杭州

在Android开发中&#xff0c;Hook技术是一种强大的手段&#xff0c;它允许开发者拦截和修改系统或应用的行为。通过Hook&#xff0c;我们可以在事件传递的过程中插入自定义的逻辑&#xff0c;从而实现对应用行为的监控和修改。 Android 系统有自己的事件分发机制&#xff0c;…

做定制网站价格网页设计做军事网站的感想

一、进程间通信方式 管道( pipe )&#xff1a;管道是一种半双工的通信方式&#xff0c;数据只能单向流动&#xff0c;而且只能在具有亲缘关系的进程间使用。进程的亲缘关系通常是指父子进程关系。有名管道 (named pipe) &#xff1a; 有名管道也是半双工的通信方式&#xff0c…