📄 savemodify.aspx.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace OI.PersonSend
{
/// <summary>
/// savemodify 的摘要说明。
/// </summary>
public class savemodify : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox TextBoxTitle;
protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;
protected System.Web.UI.WebControls.TextBox TextBoxContent;
protected System.Web.UI.WebControls.ImageButton ImageButtonsure;
protected System.Web.UI.WebControls.Label labelupfile;
protected System.Web.UI.WebControls.Label Message;
private void Page_Load(object sender, System.EventArgs e)
{
if (Session["userid"]==null)
{
Response.Write ("<script>alert('超时,请重新登录');top.location.href='../userpass.aspx';</script>");
return ;
}
if (!Page.IsPostBack )
{
try
{
int id=int.Parse (Request.Params ["id"].ToString ());
ViewState["id"]=id.ToString ();
}
catch
{
return ;
}
CreateDataSource();
}
}
private void CreateDataSource()
{
personDatum dt=new personDatum ();
DataRow dr=dt.GetRowSaveDataByID (int.Parse (ViewState["id"].ToString ()));
TextBoxTitle.Text =dr["title"].ToString ();
TextBoxContent.Text =dr["content"].ToString ();
if (dr["savepath"].ToString ().Trim () =="")
{
labelupfile.Text ="没有附件";
}
else
{
string strURL=OI.Modules .Config .GetSetting ("ReadDocuments").ToString ()+"/"+dr["savepath"].ToString ();
labelupfile.Text ="<a href=\"#\" onclick=\""+
"window.open ('"+strURL+
"','fj','top=100,left=100,toolbar=0,,status=1,menubar=0,scrollbars=1,resizable=1,width=500,height=300')"+
"\"><img src=\"../images/open.gif\" border=\"0\"></a>";
}
}
private void AddNoFileControl()
{
Label upfile=new Label ();
upfile.Text ="<INPUT class='input' id='UpFile' style='WIDTH: 280px; HEIGHT: 21px' type='file' size='27'";
upfile.Text +=" name='UpFile' runat='server'>(文件不能超过8M) ";
//panelupfile.Controls .Add (upfile);
}
private void AddHasFileControl()
{
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.ImageButtonsure.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButtonsure_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void ImageButtonsure_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -