zoukankan      html  css  js  c++  java
  • Aspx小记

    关闭按钮

     protected void Close_Click(object sender, EventArgs e)
        {
            //Page.RegisterStartupScript("close ", " <script> window.opener=null;window.top.close() </script> ");
            ClientScript.RegisterStartupScript(Page.GetType(), "close", " <script> window.opener=null;window.top.close() </script> ");
        }
    

      

    在后台里看到这样的一段代码

     Guid PK_Complaint = new Guid(dr["PK_Complaint"].ToString());//开始的时候不明白为什么还要加个new,可能是从string类型转成Guid的标准格式吧。
    

     主要是看这个out

     static void Main(string[] args)
          {
             decimal res=1;
             string str="0.1";//string str="asn";(这个是false,因为asn转不成decimal的类型
             bool convertible= decimal.TryParse(str,out res);//把str的类型,转换成res的类型
             Console.WriteLine(convertible);
             Console.ReadKey();
          }
    

      

    string[] IMEI_SN = info.Split(new char[] { ' ', ' ' }, StringSplitOptions.RemoveEmptyEntries);//算是以数组中的东西分割开来

    string test = "程$晓$";
    
      使用:string[] temp = test.Split(new string[] { "$" }, StringSplitOptions.RemoveEmptyEntries);
      输出结果:数组长度为2 temp[0]="程" temp[1]="晓";
     
    
      使用:string[] temp = test.Split(new string[] { "$" }, StringSplitOptions.None);或string[] temp = test.Split('$');
    
    
      输出结果:数组长度为3 temp[0]="程" temp[1]="晓" temp[2]="";
      
    

    在前台有个RadioButtonlist的按钮,在加载 的时候,从后台添加数据

     string[] ary = System.Configuration.ConfigurationManager.AppSettings["xxx"].Split(',');
       foreach (string i in ary)
          {
            RadioButtonList1.Items.Add(new ListItem(i));//这里的ListItem,因为Items是ListItemCollection
          } 

    在后台获取list选择的那个值:RadioButtonList1.SelectedValue.ToString() == ""
  • 相关阅读:
    Java面试中常问的Spring方面问题(涵盖七大方向共55道题,含答案)
    Node.js环境搭建
    Node.js的开源博客系统Ghost搭建教程
    探讨一个“无法创建JVM”的问题(已解决)
    Spring Boot快速入门
    Spring Boot开发Web应用
    Spring Boot工程结构推荐
    元类的剖析和单例
    多态的简单剖析、内置方法和异常的解读
    面向对象的解释和属性查找的方式解读
  • 原文地址:https://www.cnblogs.com/ZkbFighting/p/9453135.html
Copyright © 2011-2022 走看看