![](https://img-blog.csdnimg.cn/20200728114409985.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
Asp.Net学习
文章平均质量分 62
Asp.Net学习,小白一枚。
挑战不可
这个作者很懒,什么都没留下…
展开
-
ASP.NET学习(一)
1.ASP.NET常用对象如图要实现将文本框1的输入的信息填写完后,点击按钮,将信息显示在文本框2。若不进行验证,则当再次进行输入测试时,不能实现上述功能,文本框2 的信息一直为“请输入内容!”。因此要在pageLoad中进行首次的验证:protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack)//首次加载 {原创 2020-10-06 22:52:47 · 1749 阅读 · 1 评论 -
Asp.Net之JavaScript学习(三)
1.样式操作通过修改元素的style属性来操作样式,js中的style对象提供了很多属性,对应着css的相关样式,这里的写法与css中基本相同。<!DOCTYPE html><html><head> <meta charset="utf-8" /> <title>01样式</title> <style> .d1 { color: red; .原创 2020-08-02 22:15:42 · 315 阅读 · 0 评论 -
Asp.Net之MVC(四)
Razior视图模型1.文件新建此文件与Shared文件夹下的_Layout.cshtml有关。其中@RenderBody()内容为Index页面的输出内容。如果在Layout.cshtml文件中添加了@RenderSection("head"); @RenderSection("foot");等内容。在在Index.cshtml文件页要写入相应的内容。否则报错!!!!2.引用与导入可以直接使用,非常方便。3.小练习可以使...原创 2020-07-28 22:52:51 · 169 阅读 · 0 评论 -
Asp.Net之MVC(三)
1.添加用户using MvcApplication1.Models;using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;namespace MvcApplication1.Controllers{ public class HomeController : Controller { // GET: Ho原创 2020-07-27 23:38:02 · 171 阅读 · 0 评论 -
Asp.Net之MVC(二)
1.新建MVC项目由于第一次学习,就先选择空项目,然后勾选MVC选项。主要关注这三个文件夹内容。Controllers是属于控制器部分;Model是数据模型部分;Views是视图部分;2.练习通过EF框架技术将Student表结构模型建立在项目中;namespace MvcApplication1.Controllers{ public class HomeController : Controller { ..原创 2020-07-26 23:30:26 · 144 阅读 · 0 评论 -
Asp.Net之MVC(一)
1.EF(Entity Framework)EF是微软以ADO.NET为基础发展的一个ORM框架。2.实现CRUD1:添加 insert into dbo.RoomType(TypeName, Price, AddBed, BedPrice, Remark) output inserted.IDvalues('kkk',321,1,34,'oooo')exec sp_executesql N'insert [dbo].[UserInfo]([UserName], [User...原创 2020-07-25 22:58:13 · 204 阅读 · 0 评论 -
ASP.Net学习(十一)
1.GlobalGlobal:文件名称不能改,并且要放在网站的根目录下。using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Security;using System.Web.SessionState;namespace DemoProject.WebApp{ public class Global : System.Web.Htt原创 2020-07-24 23:48:12 · 109 阅读 · 0 评论 -
ASP.Net学习(十)
1.缓存(Cache) 每次进入页面的时候都查询数据库生成页面内容的话,如果访问量非常大,则网站性能会非常差。而如果只有第一次访问的时候才查询数据库生成页面内容,以后都直接输出内容,则能提高系统性能。这样无论有多少人访问都只访问一次数据库,数据库压力不变。经常访问,但是不是经常改动的数据。 ASP.Net缓存主要分为:页面缓存(中庸)、数据源缓存(最不灵活的)、自定义数据缓存(灵活)这三种主要类型。using System;using _0715StudentProject...原创 2020-07-23 23:43:07 · 110 阅读 · 0 评论 -
ASP.Net学习(九)
1.基本服务端控件练习<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Index.aspx.cs" Inherits="_2020_07_22_Index" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <meta http-equiv="Conten原创 2020-07-22 23:45:36 · 448 阅读 · 0 评论 -
ASP.Net学习(八)
1.AJAX实现CRUD<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>用户列表</title> <link href="../Css/tableStyle.css" rel原创 2020-07-21 23:54:10 · 141 阅读 · 0 评论 -
ASP.Net学习(七)
1.自动登录实现<body> <form id="form1" runat="server"> <div> 用户名:<input type="text" name="txtName" value="<%=UserName%>" /><br /> 密  码:<input type="password" name="txt原创 2020-07-20 23:56:36 · 286 阅读 · 0 评论 -
ASP.Net学习(六)
1.Cookie练习using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;public partial class _2020_07_19_CookieDemo : System.Web.UI.Page{ protected void Page_Load(object原创 2020-07-19 23:39:09 · 168 阅读 · 0 评论 -
ASP.Net学习(五)
1:Request,Response其它成员 2:Server属性3:客户端状态保持(ViewState)重点ViewState:实现状态保持的对象.隐藏域4:客户端状态保持(cookie)重点cookie:一小段文本,明文。存储在客户端的浏览器内存里面或者磁盘。cookie是跟网站相关,百度可以往客户端写cookie,sina也可写cookie,但是百度只能读取跟百度网站相关的cookie。cookie会随着请求网站一块发送到后台【如果请求百度...原创 2020-07-18 23:50:14 · 135 阅读 · 0 评论 -
ASP.Net学习(四)
1.上传图片<%@ WebHandler Language="C#" Class="ProcessFileUp" %>using System;using System.IO;using System.Web;public class ProcessFileUp : IHttpHandler{ public void ProcessRequest(HttpContext context) { context.Response.ContentT原创 2020-07-17 23:46:06 · 127 阅读 · 0 评论 -
ASP.Net学习(三)
1.CRUD练习(三层方法,与昨天不同)先看图项目结构:部分代码:<%@ WebHandler Language="C#" Class="UserInfoList" %>using System;using _0715StudentProject.Model;using _0715StudentProject.BLL;using System.Collections.Generic;using System.IO;usin...原创 2020-07-16 23:59:51 · 811 阅读 · 0 评论 -
ASP.Net学习(二)
1.Web网站与Web应用程序区别项目就是一个应用程序。在VS中查看的时候,项目中建立的一般处理程序,有两个文件,网站只有一个。写个代码测试,发现在代码层次上没有。 再有就是项目中的一般处理程序有命名空间,而网站中的没有。WEB网站每一个页面(ashx页面)都是一个独立的程序,一个页面出错了不会影响到另外一个页面(演示)。 但是项目中建立完一个文件(或修改了一个文件),一定要重新生成,生成的目的就是将项目生成对应的dll文件放bin/Debug目录下(并且所有的类放在了...原创 2020-07-15 23:41:22 · 127 阅读 · 0 评论 -
ASP.Net学习(一)
1.第一个程序目录文件:表格(非html文件):<%@ WebHandler Language="C#" Class="First" %>using System;using System.Text;using System.Web;public class First : IHttpHandler{ //请求过来找到该一般处理程序文件,自动执行ProcessRequest方法。 public void ProcessReque...原创 2020-07-14 23:50:04 · 206 阅读 · 0 评论