易截截图软件、单文件、免安装、纯绿色、仅160KB

ASP.NET代码片段

设置下拉框的初始值:
  <asp:DropDownList ID="DropDownList1" runat="server">
        <asp:ListItem Text="小学" Value="1"></asp:ListItem>
        <asp:ListItem Text="中学" Value="2"></asp:ListItem>
        <asp:ListItem Text="大学" Value="3"></asp:ListItem>
        </asp:DropDownList>
 string init = "2";
            for (int i = 0; i < DropDownList1.Items.Count; i++)
            {
                if (DropDownList1.Items[i].Value.ToString() == init)
                {
                    DropDownList1.Items[i].Selected = true;
                }
            }
  
 DropDownList1.Items.Insert(0,new ListItem("选择类别",0));
<asp:GridView ID="GridView1" ShowFooter="false" BorderColor="Black" OnRowDataBound="GridView1_RowDataBound"  runat="server" AutoGenerateColumns="False"  Font-Size="12px" Width="549px"  AllowPaging="True" >
          <Columns>
            <asp:BoundField DataField="ID" HeaderText="编号" />
             <asp:BoundField DataField="EmpBirthday" HeaderText="生日" DataFormatString="{0:yyyy-MM-dd}" HtmlEncode="False" />
      &nbs


相关文档:

asp.net里导出excel表方法汇总

 1、由dataset生成
public void CreateExcel(DataSet ds,string typeid,string FileName) 
  {
   HttpResponse resp;
   resp = Page.Response;
   resp.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
   resp.AppendHeader("Conte ......

asp.net 设置回车的默认按钮

 当我输入一个关键字想按回车键就可以搜索,但由于页面上还有其他的Button,所以默认本不是我的搜索按钮,在网上搜了些解决方案,最多的是如下这种方式:
在asp.net中,如何回车触发指定按钮的事件?
假设:
<asp:TextBox id="tbInput" runat="server" Width="240px"></asp:TextBox>
<asp:Button ......

asp.net下实现URL重写伪静态之iis设置

 下面以Test 站点为例,说明一下如何设置 .net framework 2.0 aspnet_isapi 的 IIS 设置
按如下步骤操作即可
1、打开站点,右击属性,找到主目录(本示例是以虚拟目录,服务器版本请找主目录)
打开如下图所示的窗口
                ......

ASP.NET程序的负压测试


wuyq11
(人生如梦)
进行压力测试,可使用的工具很多
如Loadrunner:预测系统行为和性能的负载测试工具
Webload:WEB性能压力测试
使用多线程
MS Web Application Stress Tool
延伸------------------------------------------------------------------------------->
《ASP.NET程序的负压测试》
......

ASP.NET中常用的三十三种代码

 1. 打开新的窗口并传送参数:
传送参数:
response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')</script>")
接收参数:
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.为按钮添加对话框
Button1.Attributes. ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号