ModifyBook.aspx.cs
资源名称:SunShine.rar [点击查看]
上传用户:tjxpgg
上传日期:2017-05-14
资源大小:2244k
文件大小:1k
源码类别:
SilverLight
开发平台:
ASP/ASPX
- 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;
- public partial class Admin_ModifyBook : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- protected void DetailsBook_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
- {
- FreeTextBoxControls.FreeTextBox ftbToc = this.DetailsBook.FindControl("FreeTextBoxToc") as FreeTextBoxControls.FreeTextBox;
- e.NewValues["TOC"] = ftbToc.Text;
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- string isbn=(this.DetailsBook.FindControl("LblISBN") as Label).Text;
- FileUpload upload = this.DetailsBook.FindControl("FileUploadCover") as FileUpload;
- if (upload.FileName.Substring(upload.FileName.Length-4,4).ToLower() != ".jpg")
- {
- Response.Write("<script language='javascript'>alert('文件类型错误');</script>");
- }
- else
- {
- string filename = Server.MapPath("~/Images/BookCovers/") + isbn + ".jpg";
- upload.PostedFile.SaveAs(filename);
- }
- }
- }