<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Admin_ADDNews.aspx.cs" Inherits="admin_Admin_ADDNews" %><!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="image/style.css" rel="stylesheet" type="text/css" />
</head>
<body style="margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px;
    background-color: #F4EEE4;" class="Dtu">
    <form id="form1" runat="server">
        <div>
            <table width="95%" border="1" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#ECEEE4"
                bordercolordark="#CCCABC">
                <tr>
                    <td colspan="3" align="center" height="20px" background="image/tablebg.gif" id="dabiaoti">
                        <b>添 加 文 章 内 容 </b>
                    </td>
                </tr>
                <tr valign="middle">
                    <td width="15%" height="25">
                        一级分类:</td>
                    <td width="42%" height="25">
                        <asp:DropDownList ID="BigClass" runat="server" Width="180px" OnSelectedIndexChanged="BigClass_SelectedIndexChanged"
                            AutoPostBack="True">
                        </asp:DropDownList></td>
                    <td width="43%" rowspan="4" align="center" id="tdPreview">
                        <asp:Image ID="Image1" runat="server" Height="100px" Width="300px" ImageUrl="~/admin/image/noPic.gif" /></td>
                </tr>
                <tr valign="middle">
                    <td height="25" id="mytitle">
                        二级分类:</td>
                    <td height="25">
                        <asp:DropDownList ID="SmallClass" runat="server" Width="180px">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr valign="middle">
                    <td height="25" id="mypic">
                        文章标题:</td>
                    <td height="25">
                        <asp:TextBox ID="Title" runat="server" Width="180px"></asp:TextBox></td>
                </tr>
                <tr valign="middle">
                    <td height="25">
                        上传默认图片:</td>
                    <td height="25">
                       <asp:FileUpload ID="UploadImage" runat="server" />
                        <asp:Button ID="UploadIma" runat="server" Text="上传" Height="18px" OnClick="UploadIma_Click" /></td>
                </tr>
                <tr valign="middle">
                    <td height="25" id="myintro">
                        关键字:</td>
                    <td height="25" colspan="2">
                        <asp:TextBox ID="Nkey" runat="server" Width="500px"></asp:TextBox>(纯文本)</td>
                </tr>
                <tr valign="middle">
                    <td height="25" id="mycontent">
                        文章内容:</td>
                    <td height="25" colspan="2">
                        <asp:textbox id="ContentContents" runat="server" style="display: none"></asp:textbox>
                        <iframe id="eWebEditor1" src="eWebEditor/eWebEditor.htm?id=ContentContent&style=coolblue" frameborder="0"
                            scrolling="no" width="100%" height="400"></iframe>
                    </td>
                </tr>
                <tr valign="middle">
                    <td height="25" id="Td1">
                        简介内容:<br />
                        (纯文本)</td>
                    <td height="25" colspan="2">
                        <textarea name="synopsis" rows="3" cols="75" id="synopsis" runat="server"></textarea>
                        (限255字符)</td>
                </tr>
                <tr valign="middle">
                    <td height="25" id="zhicheng">
                        作者:</td>
                    <td height="25" colspan="2">
                        <asp:TextBox ID="writer" runat="server" Width="300px"></asp:TextBox>
                    </td>
                </tr>
                <tr valign="middle" id="mygod">
                    <td height="25" id="laiyuan">
                        来源:</td>
                    <td height="25" colspan="2">
                        <asp:TextBox ID="writefrom" runat="server" Width="300px"></asp:TextBox>
                        &nbsp;
                    </td>
                </tr>
                <tr valign="middle">
                    <td height="12">
                        审&nbsp;&nbsp;&nbsp;&nbsp;核:</td>
                    <td height="12" colspan="2">
                        <asp:RadioButton ID="RadioButton1" runat="server" Text="通过" />
                        <asp:RadioButton ID="RadioButton2" runat="server" Text="不通过" /></td>
                </tr>
                <tr valign="middle">
                    <td height="13">
                        推荐程度:</td>
                    <td height="13" colspan="2">
                        (0表示不推荐,50表示最高推荐)</td>
                </tr>
                <tr>
                    <td height="25" colspan="3" align="center">
                        <asp:Button ID="AddNews" runat="server" Text=" 提 交 " OnClick="AddNews_Click" />
                        <asp:Button ID="Button3" runat="server" Text=" 重 置 " />
                    </td>
                </tr>
            </table>
        </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;public partial class admin_Admin_ADDNews : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack == false)
        {
            bindBigClass();
            bindSmallClass();
        }
    }
    protected void BigClass_SelectedIndexChanged(object sender, EventArgs e)
    {
        SmallClass.Items.Clear();
        SmallClass.Items.Add(new ListItem("请选择分类", "0"));
    }
    public void bindBigClass()
    {
        NewsXP.DAL.article_class Class = new NewsXP.DAL.article_class();
        string sql = "Flag = 0 order by OrderFlag desc,Unid desc";
        DataSet Ds = new DataSet();
        Ds = Class.GetList(sql);        BigClass.DataTextField = "ClassName";
        BigClass.DataValueField = "Unid";
        BigClass.DataSource = Ds.Tables[0].DefaultView;
        BigClass.DataBind();
        BigClass.Items.Insert(0, new ListItem("请选择分类", "0"));
    }
    public void bindSmallClass()
    {
        NewsXP.DAL.article_class Class = new NewsXP.DAL.article_class();
        string sql = "Flag <> 0 order by OrderFlag desc,Unid desc";
        DataSet Ds = new DataSet();
        Ds = Class.GetList(sql);        SmallClass.DataTextField = "ClassName";
        SmallClass.DataValueField = "Unid";
        SmallClass.DataSource = Ds.Tables[0].DefaultView;
        SmallClass.DataBind();
    }
    protected void AddNews_Click(object sender, EventArgs e)
    {
        //Response.Write(body.Value.ToString());
    }
    protected void UploadIma_Click(object sender, EventArgs e)
    {
        if (UploadImage.PostedFile.FileName.Trim() != null)
        {
            UploadImage Image = new UploadImage();
            //(最大宽度,最大高度,最大尺寸,缩略图宽度,缩略图高度,缩略图是否等比例,是否生成缩略图)
            Image.UpLoadIMGSet(this.UploadImage, 500, 20000, 1100000, 100, 100, true, false);
            string RegName = Image.OFileName.ToString();
            string Msg = Image.MSG.ToString();
            if (RegName == "0")
            {
                Alert.AlertRedirect("Msg请重新上传!", this.Page);
            }
            else 
            {
                Alert.AlertRedirect("上传成功!", this.Page);
            }
        }
    }
}
不知道为什么 当                        <asp:textbox id="ContentContents" runat="server" style="display: none"></asp:textbox>
中的id与ewebeidter中的id一样时就不触发DropDownList了,求教了,分不多,