Hello ASP.NET team :
I have a user control that be added into page at runtime , in a postback
event handler .
I save the information to view state , and load the user control again in
CreateChildCont rols again .
There's a datagrid in the user control .
The datagrid bind the data when the user control be loaded at the first
time.
When I use 'LinkButton' for the delete button , it work well .
When I change to 'PushButton' , an error be thrown .
I think my program have no problem . Please check why 'PushButton' has such
exception ?
----------------------------------------------------------------------------
System.Web.Http UnhandledExcept ion: Exception of type
'System.Web.Htt pUnhandledExcep tion' was thrown. --->
System.Argument Exception: Invalid postback or callback argument. Event
validation is enabled using in configuration or 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
ClientScriptMan ager.RegisterFo rEventValidatio n method in order to register
the postback or callback data for validation.
at System.Web.UI.C lientScriptMana ger.ValidateEve nt(String uniqueId, String
argument)
at System.Web.UI.C ontrol.Validate Event(String uniqueID, String
eventArgument)
at System.Web.UI.W ebControls.Butt on.RaisePostBac kEvent(String eventArgument)
at
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument)
at System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument)
at System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData)
at System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint)
--- End of inner exception stack trace ---
at System.Web.UI.P age.HandleError (Exception e)
at System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint)
at System.Web.UI.P age.ProcessRequ est(Boolean includeStagesBe foreAsyncPoint,
Boolean includeStagesAf terAsyncPoint)
at System.Web.UI.P age.ProcessRequ est()
at System.Web.UI.P age.ProcessRequ estWithNoAssert (HttpContext context)
at System.Web.UI.P age.ProcessRequ est(HttpContext context)
at ASP.page_aspx.P rocessRequest(H ttpContext context) in
c:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50727 \Temporary ASP.NET
Files\website\9 9b74d5c\80b811c 2\App_Web_2xqcs b4i.2.cs:line 0
at
System.Web.Http Application.Cal lHandlerExecuti onStep.System.W eb.HttpApplicat ion.IExecutionS tep.Execute()
at System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean&
completedSynchr onously)