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

asp.net 动态纵向菜单

 using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Common;
using System.Data.Common;
public partial class LeftMenu : System.Web.UI.Page
{
Database db = DatabaseFactory.CreateDatabase("sqlconstr2");
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
GVDataBind();
}
private void GVDataBind()
{
DbCommand dcmd = db.GetSqlStringCommand("select * from dbo.[Group] where UserID=0");
DataSet ds = db.ExecuteDataSet(dcmd);
this.GridView1.DataSource=ds.Tables[0];
this.GridView1.DataBind();
}
private void DLDataBind(DataList dl, int GID)
{

string sql = "SELECT [User].*,[GroupUser].GroupID from [GroupUser] INNER JOIN [User] ON [User].ID=[GroupUser].UserID WHERE GroupID=" + GID + "";
DbCommand dcmd = db.GetSqlStringCommand(sql);
DataSet ds = db.ExecuteDataSet(dcmd);
dl.DataSource = ds.Tables[0];
dl.DataBind();
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
DataList dlUser = (DataList)e.Row.FindControl("DataList1");
if (dlUser != null)
{ ///绑定数据
DLDataBind(dlUser, Int32.Parse(this.GridView1.DataKeys[e.Row.RowIndex].Value.ToString()));
}
}
}

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LeftMenu.aspx.cs" Inherits="LeftMenu" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题


相关文档:

浅谈ASP.net安全编程

在Web编程过程中,存在着很多安全隐患。比如在以前的ASP版本中,Cookie为访问者和编程者都提供了方便,并没有提供加密的功能。打开IE浏览器,选择“工具”菜单里的“Internet选项”,然后在弹出的对话框里单击“设置”按钮,选择“查看文件”按钮,在弹出的窗口中,就会显示硬盘里 ......

asp.net 当前页 关闭 父类页

//在当前页中关闭
 Response.Write("<Script>window.opener.opener= null;window.opener.location.replace(window.opener.location.href='ideabank.aspx');window.close();</Script>");
//父类页打开 子页
 Response.Write("<script>window.open('upideabank.aspx?id="+id+"','','height=50 ......

asp.net发布网站


通常部属网站的时候需要编译那些需要的文件,和一些系统需要的组件。
会感觉到很繁琐。
发布网站是一个不错的选择:直接发布服务器上,设置好站点与端口即可。以下是总结的步骤。。。
第一、是将网站里所有的数据连接都做成从web.config中读取,这样的话,就可以一劳永逸了。
第二、就是IIS设置了,在IIS中的asp.net中 ......

asp.net页面生命周期 各时期事件

using System;
using System.Collections.Specialized;
using System.Data;
using System.Configuration;
using System.Collections;
using System.IO;
using System.Threading;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebC ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号