日期:2014-05-17 浏览次数:20382 次
<!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></title>
<link href="NewsCss.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div>
<div class="sc_chanpin">
<asp:Label ID="Label1" runat="server" Text="选择上传的图片:"></asp:Label>
<asp:FileUpload ID="FileUpload1" runat="server" />
</div>
<div class="sc_chanpin">
<asp:Label ID="Label2" runat="server" Text="写入图片介绍:"></asp:Label>
<asp:TextBox ID="shuoming" runat="server" TextMode="MultiLine"></asp:TextBox>
</div>
<asp:Label ID="lbMessage" runat="server" Text="Label"></asp:Label>
<asp:ImageButton ID="ImageButton1" runat="server" OnClick="imgBtnLoad_Click" />
</div>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
public partial class houtai_chanpinManager : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ }
protected void imgBtnLoad_Click(object sender, ImageClickEventArgs e)
{
if (!FileUpload1.HasFile)
{
lbMessage.Text = "请选择上传图片!";
return;
}
else
{