单击母版链接按钮时发生错误 [英] error when masterpage linkbutton is clicked

查看:91
本文介绍了单击母版链接按钮时发生错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

单击母版链接时出现一个错误.我在一页上使用脚本管理器,它是使用母版页.主页上没有脚本管理器.

错误是:

Hello,

i have a one error when masterpage linkutton is clicked. i use script manager on one page and it is use master page. there is no script manager in Master page.

error is :

Invalid postback or callback argument.  Event validation is enabled using <pages enableeventvalidation="true" /> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.



请帮助我.

在此先感谢.
MItesh



Please help Me..

Thanks in Advance.
MItesh

推荐答案

在aspx页中添加EnableEventValidation="true",如下所示

Add EnableEventValidation="true" in aspx page as below

<![CDATA[<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" EnableEventValidation="false" %>



如果得到答案,请标记为解决方案.

谢谢
Ashish



Mark it solution if you get your answer.

Thanks
Ashish


在此处查看此视频,它将帮助您解决问题.

http://www.asp. net/web-forms/videos/aspnet-ajax/how-do-i-use-an-aspnet-ajax-scriptmanagerproxy [
Check this video here, it will help you to solve your problem.

http://www.asp.net/web-forms/videos/aspnet-ajax/how-do-i-use-an-aspnet-ajax-scriptmanagerproxy[^]


Cheers


这是因为在请求服务器时,即回发编译器时,它会得到诸如sysntax之类的标记或一些无效的运算符,因此显示出问题.因此,您可以在页面上检查属性指令
为了解决这些问题,我们曾经添加CDATA部分,但这不是一个好主意,请尝试将ScriptManager放置在母版页上或更改属性.
This is because while requesting to server i.e.while postback the compiler getting some tag like sysntax or some invalid operator so it is showing problem.so you can check your attributes at page directive
To solve these problems we used to add CDATA section but that is not good idea,try placing ScriptManager on Master page or change the attribute.


这篇关于单击母版链接按钮时发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆