dropdownlist下拉列表+框架实现页面转向
2007-10-06 23:03
405 查看
首先三个文件
baobiao/liucheng.aspx \\框架文件
baobiao/liucheng_zhuan.aspx \\dropdownlist控件
baobiao/liucheng_xianshi.aspx \\显示 链接的页
1.//liucheng.aspx文件
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="liucheng.aspx.cs" Inherits="baobiao_biao1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<frameset rows="80,*,80" frameborder="no" border="0" framespacing="0">
<frame src="liucheng_zhuan.aspx?sh=0" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
<frame src="liucheng_xianshi.aspx" name="manframe" id="manframe" title="manframe" />
</frameset>
<noframes><body>
</body>
</noframes></html>
2.liucheng_zhuan.aspx主要文件
界面层文件code
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged1">
</asp:DropDownList> </div>
绑定文件代码
code con = new code();
protected void Page_Load(object sender, EventArgs e)
{
Session["empid"] = 133;
this.xianshi();
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
}
/// <summary>
/// 根据参数显示下拉列表内容
/// </summary>
private void xianshi()
{
if (!IsPostBack)
{
string strsql = "";
if (Request["sh"] != null)
{
if (Request["sh"].ToString() == "0")
{
strsql = "select * from td_rep_process where rep_oneshow like '%;" + Session["empid"].ToString() + ";%'";
}
else if (Request["sh"].ToString() == "1")
{
strsql = "select * from td_rep_process where rep_towshow like '%;" + Session["empid"].ToString() + ";%'";
}
con.XiaLaBiao(strsql, DropDownList1, "rep_name", "rep_id");
}
}
}
protected void DropDownList1_SelectedIndexChanged1(object sender, EventArgs e)
{
string strsql = "select * from td_rep_process where rep_id =" + Request["DropDownList1"].ToString() + "";
DataSet ds = con.conDataSet(strsql);
foreach (DataRow row in ds.Tables[0].Rows)
{
RegisterStartupScript("", "<script language=\"javascript\"> window.open('" + row["rep_sjpwfrm"].ToString() + "?deptid=1&dep=岱岳区供电部&sh=" + Request["sh"].ToString() + "', target = \"manframe\");</script>"); //实现页面转向manframe框架中,registerstartupscript应用.
}
}
}
这里用到一个code
public static string htmlfilename;
/// <summary>
/// code 的摘要说明
/// </summary>
public class code
{
public static string htmlfilename;
public code()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
///<summary>
/// 绑定gridview 第一参数:string sql,第二参数:GridView gridview
/// </summary>
public void BDGridView(string sql, GridView gridview)
{
System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings["ConnString"].ConnectionString.ToString());
try
{
con.Open();
string strcom = sql;
System.Data.SqlClient.SqlDataAdapter rs = new System.Data.SqlClient.SqlDataAdapter(sql, con);
DataSet ds = new DataSet();
rs.Fill(ds);
gridview.DataSource = ds.Tables[0].DefaultView;/
gridview.DataBind();
}
finally
{
con.Close();
}
}
liucheng_xianshi.aspx文件可以设置一个其实显示页面.
下载源文件
les/9who/baobiao.rar
baobiao/liucheng.aspx \\框架文件
baobiao/liucheng_zhuan.aspx \\dropdownlist控件
baobiao/liucheng_xianshi.aspx \\显示 链接的页
1.//liucheng.aspx文件
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="liucheng.aspx.cs" Inherits="baobiao_biao1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<frameset rows="80,*,80" frameborder="no" border="0" framespacing="0">
<frame src="liucheng_zhuan.aspx?sh=0" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
<frame src="liucheng_xianshi.aspx" name="manframe" id="manframe" title="manframe" />
</frameset>
<noframes><body>
</body>
</noframes></html>
2.liucheng_zhuan.aspx主要文件
界面层文件code
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged1">
</asp:DropDownList> </div>
绑定文件代码
code con = new code();
protected void Page_Load(object sender, EventArgs e)
{
Session["empid"] = 133;
this.xianshi();
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
}
/// <summary>
/// 根据参数显示下拉列表内容
/// </summary>
private void xianshi()
{
if (!IsPostBack)
{
string strsql = "";
if (Request["sh"] != null)
{
if (Request["sh"].ToString() == "0")
{
strsql = "select * from td_rep_process where rep_oneshow like '%;" + Session["empid"].ToString() + ";%'";
}
else if (Request["sh"].ToString() == "1")
{
strsql = "select * from td_rep_process where rep_towshow like '%;" + Session["empid"].ToString() + ";%'";
}
con.XiaLaBiao(strsql, DropDownList1, "rep_name", "rep_id");
}
}
}
protected void DropDownList1_SelectedIndexChanged1(object sender, EventArgs e)
{
string strsql = "select * from td_rep_process where rep_id =" + Request["DropDownList1"].ToString() + "";
DataSet ds = con.conDataSet(strsql);
foreach (DataRow row in ds.Tables[0].Rows)
{
RegisterStartupScript("", "<script language=\"javascript\"> window.open('" + row["rep_sjpwfrm"].ToString() + "?deptid=1&dep=岱岳区供电部&sh=" + Request["sh"].ToString() + "', target = \"manframe\");</script>"); //实现页面转向manframe框架中,registerstartupscript应用.
}
}
}
这里用到一个code
public static string htmlfilename;
/// <summary>
/// code 的摘要说明
/// </summary>
public class code
{
public static string htmlfilename;
public code()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
///<summary>
/// 绑定gridview 第一参数:string sql,第二参数:GridView gridview
/// </summary>
public void BDGridView(string sql, GridView gridview)
{
System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings["ConnString"].ConnectionString.ToString());
try
{
con.Open();
string strcom = sql;
System.Data.SqlClient.SqlDataAdapter rs = new System.Data.SqlClient.SqlDataAdapter(sql, con);
DataSet ds = new DataSet();
rs.Fill(ds);
gridview.DataSource = ds.Tables[0].DefaultView;/
gridview.DataBind();
}
finally
{
con.Close();
}
}
liucheng_xianshi.aspx文件可以设置一个其实显示页面.
下载源文件
les/9who/baobiao.rar
相关文章推荐
- dropdownlist下拉列表+框架实现页面转向
- 淘宝页面实现(包括级联菜单,下拉列表,框架)
- MVC5用AJAX实现一个下拉列表的值改变,另一个下拉列表的值跟着变(在不更新整个页面的前提下,且调用后台函数)
- jQuery + jQuery Mobile 实现省市二级下拉列表页面
- android 实现两个数字的乘法,页面之间的传值 以及菜单下拉列表的使用
- MVC 页面实现ajax刷新联动下拉列表
- 不用java代码在页面实现下拉列表
- js技术实现html页面解析xml文档的级联下拉列表操作
- 用Ajax技术和dwr框架两种方式实现下拉列表的级联效果
- (转)基于MVC4+EasyUI的Web开发框架经验总结(6)--在页面中应用下拉列表的处理
- yii 下拉列表多级联动 dropDownList 实现
- 后台管理的第一个页面以及实现一个下拉列表自定义控件
- 基于MVC4+EasyUI的Web开发框架经验总结(6)--在页面中应用下拉列表的处理
- UITableView下拉刷新页面的实现(有框架)
- 如何在SharePoint2007中实现下拉列表(DropDownList)的级联菜单效果
- 基于MVC+EasyUI的Web开发框架经验总结(6)--在页面中应用下拉列表的处理
- 关于在GridView模版里添加DropDownList实现根据下拉列表的不同选择gridview根据条件筛选显示。
- 使用自定义的item、Adapter和AsyncTask、第三方开源框架PullToRefresh联合使用实现自定义的下拉列表(从网络加载图片显示在item中的ImageView)
- 使用自定义的item、Adapter和AsyncTask、第三方开源框架PullToRefresh联合使用实现自定义的下拉列表(从网络加载图片显示在item中的ImageView)
- 实例4-5 实现联动打的下拉列表DropDownList控件