Ext中弹出一个Panel面板信息,面板信息从数据库中读取

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserInfo.aspx.cs" Inherits="GPM.UserInfo" %> <!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>Ext中弹出一个Panel面板信息,面板信息从数据库中读取</title> <link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" mce_href="resources/css/ext-all.css" /> <mce:script type="text/javascript" src="adapter/ext/ext-base.js" mce_src="adapter/ext/ext-base.js"></mce:script> <mce:script type="text/javascript" src="adapter/ext/ext-all.js" mce_src="adapter/ext/ext-all.js"></mce:script> </head> <body> <form id="form1" runat="server"> <div> <mce:script type="text/javascript"><!-- Ext.onReady(function() { //初始化Extjs Ext.QuickTips.init(); //从本地加载图片,如果不定义默认从Exj官方网站加载 Ext.BLANK_IMAGE_URL ='./resources/images/default/s.gif'; //用户工号 var txtAccount=new Ext.form.TextField({ name:"txtAccount", fieldLabel:"用户工号", value:"<%=Account %>", readOnly:true, allowBlank:false, width:100 }); //用户名称 var txtUser=new Ext.form.TextField({ name:"txtUser", fieldLabel:"姓名", value:"<%=UserName %>", readOnly:true, allowBlank:false, width:100 }); //用户部门 var txtdepart=new Ext.form.TextField({ name:"txtdepart", fieldLabel:"部门名称", value:"<%=DepartMent %>", readOnly:true, allowBlank:false, width:100 }); //用户角色 var txtrole=new Ext.form.TextField({ name:"txtrole", fieldLabel:"角色名称", value:"<%=Role %>", readOnly:true, allowBlank:false, width:100 }); //用户类型 var txttype=new Ext.form.TextField({ name:"txttype", fieldLabel:"用户类型", value:"<%=UserType %>", readOnly:true, allowBlank:false, width:100 }); //电话号码 var txtphone=new Ext.form.TextField({ name:"txtphone", fieldLabel:"电话号码", value:"<%=Phone %>", readOnly:true, allowBlank:false, width:100 }); //修改密码弹出修改密码Panel var btn=new Ext.Button({ id:"update", name:"update", text:"&nbsp;修改密码", disabled : false, handler:function() { PwdWin.show(); } }); //个人账户面板 var UserPanel=new Ext.FormPanel({ id:"UserInfo", frame:true, height:300, width:270, layout:"form", items: [ txtAccount,txtUser,txtdepart,txtrole,txttype,txtphone ], buttons: [ btn ], buttonAlign:"center" }); var UserWin=new Ext.Window({ id:'UserWin', width:240, height:270, autoHeight:false, closeAction:"hide", layout: 'fit', plain: true, title:'个人账户信息', items:UserPanel }); UserWin.show(); }); // --></mce:script> </div> </form> </body> </html>

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 Entity; using Utility; using Business; namespace GPM { public partial class UserInfo : System.Web.UI.Page { //用户名称 public string UserName = string.Empty; //用户工号 public string Account = string.Empty; //用户角色名称 public string Role = string.Empty; //用户类型 public string UserType = string.Empty; //电话号码 public string Phone = string.Empty; //部门 public string DepartMent = string.Empty; //UserID public string UserID = string.Empty; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["Account"] != null) { UserName = Session["Account"].ToString(); string Where = "UserName=" + "'" + UserName + "'"; DataTable DT = new Business.User.UserInfo().GetDataByOption("Users", Where); if (DT.Rows.Count > 0) { Account = DT.Rows[0]["IndustryNum"].ToString(); UserType = DT.Rows[0]["UserType"].ToString(); DepartMent = DT.Rows[0]["Department"].ToString(); Phone = DT.Rows[0]["Tel"].ToString(); UserID = DT.Rows[0]["UserID"].ToString(); Role = new Business.User.UserInfo().GetRoleByUserID(UserID).Rows[0][0].ToString(); } //GetRoleByUserID } } } } }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值