| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1683 人关注过本帖
标题:求助,点击repeater中的imagebutton,提示回发或回调参数无效。
只看楼主 加入收藏
winners
Rank: 6Rank: 6
来 自:济南
等 级:侠之大者
威 望:1
帖 子:105
专家分:416
注 册:2009-3-20
结帖率:0
收藏
已结贴  问题点数:0 回复次数:3 
求助,点击repeater中的imagebutton,提示回发或回调参数无效。
“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------

回发或回调参数无效。在配置中使用 <pages enableEventValidation="true"/> 或在页面中使用 <%@ Page EnableEventValidation="true" %> 启用了事件验证。出于安全目的,此功能验证回发或回调事件的参数是否来源于最初呈现这些事件的服务器控件。如果数据有效并且是预期的,则使用 ClientScriptManager.RegisterForEventValidation 方法来注册回发或回调数据以进行验证。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.ArgumentException: 回发或回调参数无效。在配置中使用 <pages enableEventValidation="true"/> 或在页面中使用 <%@ Page EnableEventValidation="true" %> 启用了事件验证。出于安全目的,此功能验证回发或回调事件的参数是否来源于最初呈现这些事件的服务器控件。如果数据有效并且是预期的,则使用 ClientScriptManager.RegisterForEventValidation 方法来注册回发或回调数据以进行验证。

源错误:

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。  

堆栈跟踪:


[ArgumentException: 回发或回调参数无效。在配置中使用 <pages enableEventValidation="true"/> 或在页面中使用 <%@ Page EnableEventValidation="true" %> 启用了事件验证。出于安全目的,此功能验证回发或回调事件的参数是否来源于最初呈现这些事件的服务器控件。如果数据有效并且是预期的,则使用 ClientScriptManager.RegisterForEventValidation 方法来注册回发或回调数据以进行验证。]
   System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +2131456
   System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) +106
   System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +32
   System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5087

 


--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.1891; 版本:2.0.50727.1879
搜索更多相关主题的帖子: 服务器 安全 应用程序 pages 
2011-10-18 13:51
dotnetcode
Rank: 2
等 级:论坛游民
帖 子:30
专家分:78
注 册:2011-9-8
收藏
得分:20 
把你的repeater贴出来看看撒

[url=http://www.]中国乡卫网[/url]
2011-10-19 08:19
winners
Rank: 6Rank: 6
来 自:济南
等 级:侠之大者
威 望:1
帖 子:105
专家分:416
注 册:2009-3-20
收藏
得分:0 
<%@ Page Language="C#" MasterPageFile="~/Admin/ADMIN.master" AutoEventWireup="true"  CodeFile="ArticleList.aspx.cs" Inherits="Admin_ArticleList"  Title="无标题页" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<div style="text-align:center ;">
<font style="color:Blue ; font-family :华文行楷;font-size:xx-large ;">文章列表</font>
    <asp:Repeater ID="articleList" runat="server"
        onitemcommand="articleList_ItemCommand">
        <HeaderTemplate >        
        <table  style="padding :0px;width:100%;" border ="0px": cellpadding ="0"; cellspacing ="1";>      
        <tr align ="center" style ="background-color:Gray;"><td width="80px">标题</td><td width="80px">作者</td><td>发表时间</td><td>文章内容</td><td>详细信息</td><td>编辑</td><td>删除</td></tr>
        </HeaderTemplate>        
        <ItemTemplate >      
        <tr  onmouseover="c=this.style.backgroundColor;this.style.backgroundColor='Gray';" onmouseout="this.style.backgroundColor=c;" style ='background-color:<%#(Container.ItemIndex%2==0)?"White":"LightGreen"%>' align ="center" >
        <td><%#DataBinder .Eval (Container.DataItem,"title") %></td>
        <td><%#DataBinder .Eval (Container.DataItem,"author") %></td>
        <td align ="left" width="130px">
        <%#DataBinder .Eval (Container.DataItem,"time") %>
        </td>
        <td align="left" width="300px" >
        <asp:Literal ID ="content" runat ="server" Text = '<%#DataBinder.Eval(Container.DataItem,"content").ToString().Substring(0,1)+"......" %>'/>
        </td>
        <td width="100px">
        <asp:LinkButton ID ="lbtnDetail" runat ="server" Text ="详细信息"></asp:LinkButton>
        </td>
        <td width="50px">
        <asp:LinkButton ID ="lbtnEdit" runat ="server" Text ="编辑"></asp:LinkButton>
        </td>
        <td width="50px">
       <!-- <asp:LinkButton ID ="lbtnDel" runat ="server" CommandArgument ='<%#DataBinder .Eval (Container.DataItem,"id")%>' CommandName ="Del" Text ="删除"></asp:LinkButton>-->
        <asp:ImageButton ID="imgDel" runat ="server" CommandArgument ='<%#DataBinder .Eval (Container.DataItem,"id")%>' CommandName ="Dels" ImageUrl="/IMAGES/DEL.ico"/>
        </td>
        </ItemTemplate>
        <FooterTemplate ></table></FooterTemplate>
        </asp:Repeater>
</div>
</asp:Content>

++++++++++++++++++++++++++++++++++++++
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using ManagerBLL;

public partial class Admin_ArticleList : System.Web.UI.Page
{
    private void article()//文章列表
    {
        if (Session["admin"] == "")
        {
            Response.Redirect("Login.aspx");
        }
        else
        {
            Manage ma = new Manage();
            DataSet ds = ma.article();
            articleList.DataSource = ds.Tables[0].DefaultView;
            articleList.DataBind();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        article();
    }
    protected void articleList_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
            if ( == "Dels")
            {
                Response.Write("<script>alert("+ .ToString ()+");</script>");
                Manage ms = new Manage();
                bool flag = ms.del_articles(Convert.ToInt16());
                if (flag)
                {
                    Response.Write("<script>alert('删除成功!');</script>");
                    article();
                }
                else
                    Response.Write("<script>alert('删除失败!');</script>");
            }
    }
}
2011-10-19 10:46
winners
Rank: 6Rank: 6
来 自:济南
等 级:侠之大者
威 望:1
帖 子:105
专家分:416
注 册:2009-3-20
收藏
得分:0 
linkbutton没问题,imagebutton就不可以,点击进不了后台
2011-10-19 10:48
快速回复:求助,点击repeater中的imagebutton,提示回发或回调参数无效。
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015929 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved