<%@ Register TagPrefix="zMenu" TagName="leftmenu" Src="leftmenu.ascx" %>
<%@ Page language="c#" Codebehind="Article.aspx.cs" AutoEventWireup="false" Inherits="_lib.CMS.Article" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Article</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<LINK href="/style.css" type="text/css" rel="stylesheet">
</HEAD>
<body bgColor="#e6e7e8" leftMargin="0" topMargin="0" marginheight="0" marginwidth="0">
<form id="MainForm" method="post" runat="server">
<input type="hidden" id="txtID" runat="server">
<table cellSpacing="0" cellPadding="0" width="778" align="center" bgColor="#ffffff" border="0">
<tr>
  <td colSpan="2"><img src="../images/top.jpg"  width="768" height="120"></td>
</tr>
<tr>
<td vAlign="top" bgColor="#cceeff">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td align="left" background="images/bgimg.gif" width="180" height="3"></td>
</tr>
<tr>
<td>
<zMenu:leftmenu runat="server" id="leftmenu1" src="menu.xml" column="Column" />
</td>
</tr>
</table>
</td>
<td vAlign="top">
<table cellSpacing="0" cellPadding="0" border="0">
<tr>
<td background="images/bgimg.gif" width="598" height="3"></td>
</tr>
<tr>
<td>
<table cellSpacing="0" cellPadding="18" width="100%" align="center" border="0">
<tr>
<td>
<p>
<br>
<TABLE class="content" id="Table1" cellSpacing="1" cellPadding="2" width="548" bgColor="#cccccc"
border="0">
<TR bgColor="#ff9900">
<TD class="whitetitle" colSpan="2">
<DIV id="lblTitle" runat="server">文章资料:</DIV>
</TD>
</TR>
<TR>
<TD width="129" bgColor="#ffffff" style="WIDTH: 129px">文章标题
<asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ControlToValidate="txtArticleTitle"
ErrorMessage="文章标题不能为空">*</asp:RequiredFieldValidator></TD>
<TD bgColor="#ffffff"><INPUT id="txtArticleTitle" style="BORDER-RIGHT: #939598 1px solid; BORDER-TOP: #939598 1px solid; BACKGROUND: #ffffff; BORDER-LEFT: #939598 1px solid; BORDER-BOTTOM: #939598 1px solid; HEIGHT: 17px"
type="text" size="69" name="username" runat="server"></TD>
</TR>
<TR>
<TD width="129" bgColor="#ebf8fe" style="WIDTH: 129px">文章正文
<asp:RequiredFieldValidator id="RequiredFieldValidator2" runat="server" ControlToValidate="txtArticleContent"
ErrorMessage="文章正文不能为空">*</asp:RequiredFieldValidator></TD>
<TD bgColor="#ebf8fe"><TEXTAREA id="txtArticleContent" style="BORDER-RIGHT: #939598 1px solid; BORDER-TOP: #939598 1px solid; BACKGROUND: #ffffff; BORDER-LEFT: #939598 1px solid; WIDTH: 447px; BORDER-BOTTOM: #939598 1px solid; HEIGHT: 96px"
type="text" size="69" name="realname" runat="server"></TEXTAREA></TD>
</TR>
<TR>
<TD width="129" bgColor="#ffffff" style="WIDTH: 129px">文章作者</TD>
<TD bgColor="#ffffff"><INPUT id="txtArticleAuthor" style="BORDER-RIGHT: #939598 1px solid; BORDER-TOP: #939598 1px solid; BACKGROUND: #ffffff; BORDER-LEFT: #939598 1px solid; BORDER-BOTTOM: #939598 1px solid; HEIGHT: 17px"
type="text" size="69" name="division" runat="server"></TD>
</TR>
</TABLE>
<TABLE class="content" id="Table2" style="WIDTH: 548px" cellSpacing="1" cellPadding="2"
width="548" border="0">
<TR align="center">
<TD bgColor="#ffffff" colSpan="2"><INPUT id="btnOK" type="image" height="20" width="61" src="images/button_OK.gif" border="0"
name="Image1" runat="server" alt="修改">
</TD>
<TD bgColor="#ffffff" colSpan="2"><INPUT id="btnResource" type="image" height="20" width="61" src="images/button_res.gif"
border="0" name="Image2" runat="server" alt="关联图片">
</TD>
<TD bgColor="#ffffff" colSpan="2"><INPUT id="btnRe" type="image" height="20" width="61" src="images/button_re.gif" border="0"
name="Image3" runat="server" alt="管理评论">
</TD>
</TR>
</TABLE>
<br>
<asp:ValidationSummary id="ValidationSummary1" runat="server" Height="18px" Width="560px" HeaderText="由于如下错误,信息不能提交:"></asp:ValidationSummary>
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgColor="#e6e7e8" colSpan="2"><IMG height="1" src="images/s.gif" width="778" border="0"></td>
</tr>
</table>
<!-- #include virtual="/foot.inc" -->
</form>
</body>
</HTML>

解决方案 »

  1.   

    ref:http://advance.cnblogs.com/archive/2006/07/04/442651.html
      

  2.   

    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 _lib.CMS
    {
    /// <summary>
    /// User 显示用户信息。
    /// </summary>
    public class User : System.Web.UI.Page
    {
    protected System.Web.UI.HtmlControls.HtmlGenericControl lblTitle;
    protected System.Web.UI.HtmlControls.HtmlInputHidden txtID;
    protected System.Web.UI.HtmlControls.HtmlInputImage btnOK;
    protected System.Web.UI.HtmlControls.HtmlInputText txtUsername;
    protected System.Web.UI.HtmlControls.HtmlInputText txtUserPwd;
    protected System.Web.UI.HtmlControls.HtmlInputText txtUserRealname;
    protected System.Web.UI.HtmlControls.HtmlInputText txtUserTel;
    protected System.Web.UI.HtmlControls.HtmlInputText txtUserEmail;
    private string FUserID;
    protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;
    protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;
    protected System.Web.UI.WebControls.ValidationSummary ValidationSummary1;
    private bool FIsNew; private void Page_Load(object sender, System.EventArgs e)
    {
    // (本功能为管理员专用)权限检查
    TCmsUser.CheckAdmin(this); // 在此处放置用户代码以初始化页面
    FUserID= this.Request["id"];
    FIsNew= (FUserID==null); txtID.Value= FUserID; if (!IsPostBack && !FIsNew)
    {
    // 显示用户细节信息
    LoadDetail();
    }
    } #region Web 窗体设计器生成的代码
    override protected void OnInit(EventArgs e)
    {
    //
    // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
    //
    InitializeComponent();
    base.OnInit(e);
    } /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {
    this.btnOK.ServerClick += new System.Web.UI.ImageClickEventHandler(this.btnOK_ServerClick);
    this.Load += new System.EventHandler(this.Page_Load); }
    #endregion private void LoadDetail()
    {
    TCmsUser oUser= new TCmsUser(FUserID);
    oUser.Select();
    txtUsername.Value     = oUser.Username;
    txtUserPwd.Value      = oUser.UserPwd;
    txtUserRealname.Value = oUser.UserRealName;
    txtUserTel.Value      = oUser.UserTel;
    txtUserEmail.Value    = oUser.UserEmail;
    } private void btnOK_ServerClick(object sender, System.Web.UI.ImageClickEventArgs e)
    {
    TCmsUser oUser= new TCmsUser(FUserID);
    oUser.Username     = txtUsername.Value;
    oUser.UserPwd      = txtUserPwd.Value;
    oUser.UserRealName = txtUserRealname.Value;
    oUser.UserTel      = txtUserTel.Value;
    oUser.UserEmail    = txtUserEmail.Value;
    if (FIsNew)
    {
    oUser.Insert();
    }
    else
    {
    oUser.Update();
    } // 跳转返回
    string strResponse="";
    strResponse+= "<script language='javascript'>";
    strResponse+= "alert('Data Changed.');";
    strResponse+= "if (opener) {";
    strResponse+= "  window.close();";
    strResponse+= "} else {";
    strResponse+= "  window.location.href='UserList.aspx';";
    strResponse+= "}";
    strResponse+= "</script>";
    this.Response.Write(strResponse);
    }
    }
    }
      

  3.   

    值的格式不是正确的GUID的格式.你最好看一下这个值是什么,为什么是错的.
      

  4.   

    catch一下看哪一行报的错出错行字符串的内容是什么