zoukankan      html  css  js  c++  java
  • ASP.NET一些常用的技巧

    //如果新闻标题大于某个值就让它后面的省掉
    public   string   shengyue(string   str,   int   Int)    
      {    
       if   (str.Length   <=   Int)    
       {    
        return   str;    
       }    
       else    
       {    
        str   =   str.Substring(0,Int)   +   "...";    
        return   str;    
       }    
      }
    HTML代码:<%# shengyue(DataBinder.Eval(Container.DataItem,"title").ToString(),13)%>


    //防止刷新重复提交:

    Response.Write("<script language='javascript'>alert('信息发表成功!');window.location = '" + Request.Url +"'</script>");

    //后台调用前台脚本验证代码
    Button1.Attributes.Add("onclick" ,"javascript:data();");

    //插入一条数据后立即获取这条ID的值
    string   strSql_InsertFlow   =   "insert   into   data_news(title,body)   values('"+title.Trim()+"','"+body.Trim()+"');select   @@identity   as 'newid'";

    //禁止后退按钮
    Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);



  • 相关阅读:
    变量的使用
    Matrix Operations
    Modify tensor shape
    张量的创建
    feed_dict 的使用
    安装并配置 HBase2.2.2
    HDFS 编程实践(Hadoop3.1.3)
    TensorFlow的安装
    GUI tkinter (Menu) -弹出菜单
    GUI tkinter (Menu) -下拉菜单
  • 原文地址:https://www.cnblogs.com/AeroJin/p/1183756.html
Copyright © 2011-2022 走看看