zoukankan      html  css  js  c++  java
  • ASP.NET常用代码汇总

    1. 打开新的窗口并传送参数:
    传送参数:
    response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')</script>")

    2.跳转到新页面

    Response.Write("<script>window.location='http://www.51aspx.com/bizpulic/upmeb.aspx'</script>");

    3.为按钮添加对话框

    在aspx前台页面:

    <asp:Button ID="btn1" runat="server" Text="按钮1" onclick="btn1_Click"  OnClientClick="return confirm('确认删除活动吗?')" />

    在cs后台文件:

    Button1.Attributes.Add("onclick","return confirm('确认?')");

    button.attributes.add("onclick","if(confirm('are you sure...?')){return true;}else{return false;}")

    4.删除文件

    string filename ="20059595157517.jpg";
    pub.util.DeleteFile(HttpContext.Current.Server.MapPath("../file/")+filename);

  • 相关阅读:
    EveryOne Piano
    3D扫描商店
    Substance PBR Guide
    C2GOASM
    Unity调试外部DLL
    BinaryReader优化
    IL
    如何画头发
    Bitrix24
    Mac查找包含指定字符串的文件
  • 原文地址:https://www.cnblogs.com/zxx193/p/3467823.html
Copyright © 2011-2022 走看看