zoukankan      html  css  js  c++  java
  • ASP.NET知识点

    1、在页面中输出数据(后台代码弹出提示框)

           (1)、Response.Write("<script>alert('上传成功!');</script>");  或者  Response.Write("<script>alert('"+str_message+"');</script>"); 

           (2)、RegisterStartupScript("true","<script>alert('上传成功!')</script>");

     2、页面跳转并传递参数  (在页面重定向URL时传递参数,使用”?“分隔页面的链接地址和参数,多个参数时,参数与参数间用”&“分隔)

             (1)Response.Redirect("~/welcome.aspx“);

             (2)Response.Redirect("~/welcome.aspx?parameter=one“);

             (3)Response.Redirect("~/welcome.aspx?Name="+name+"&Sex="+sex);

                    在welcome.aspx页面的后台代码中获取参数 ,三种方法:

                       string name=Request["Name"];

                       string name = Request.Params["Name"];

                       string name = Request.QueryString["Name"];

    3、Response.Write("<hr>"); 横线      Response.Write("<br>");换行

    4、Application对象

    5、使用Session 对象存储和读取数据

             Session["UserName"] = txtUserName.Text;//使用Session变量记录用户名   (页面1中)

              Response.Write("欢迎用户"+Session["UserName"].ToString ()+"登录本系统!<br>");   (页面2中)

    6、Cookie 对象  

                (1)读取客户端IP

                 string UserIP = Request.UserHostAddress.ToString();
                 Response.Cookies["IP"].Value = UserIP;

                (2)写入标签  this.Label1.Text = Request.Cookies["IP"].Value;      

     7、Server对象   

                    属性:MachineName  (获取服务器的计算机名称)   ;  ScriptTimeout   (获取和设置请求超时值)

         8、  

    IndexOf、LastIndexOf、Substring的用法
  • 相关阅读:
    上一篇、下一篇之实现思路
    sql优化
    简易的文件上传 tp5
    phpqrcode生成二维码
    php 发送邮件(2)qq邮箱开通
    php 发送邮件(1)代码逻辑
    SELECT list is not in GROUP BY clause and contains nonaggregated
    TP5 未定义变量:XXX
    CentOS 7下载
    FFT算法实现——基于GPU的基2快速傅里叶变换
  • 原文地址:https://www.cnblogs.com/zhangyonglvdaomei/p/3720736.html
Copyright © 2011-2022 走看看