Microsoft
Software
Hardware
Network
Question : How to add Button control to DataList control
I get the postback error below when i click my button control. How do i fix this isue? My code is listed below.
Server Error in '/' Application.
--------------------------
----------
----------
----------
----------
----------
----
Invalid postback or callback argument. Event validation is enabled using
in configuration or <%@ Page EnableEventValidation="tru
e" %> 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.Regist
erForEvent
Validation
method in order to register the postback or callback data for validation.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Invalid postback or callback argument. Event validation is enabled using
in configuration or <%@ Page EnableEventValidation="tru
e" %> 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.Regist
erForEvent
Validation
method in order to register the postback or callback data for validation.
//////////////////////////
////// source code
//////////////////////////
/////// codebehind
private void Page_Load(object sender, System.EventArgs e)
{
ArrayList al = new ArrayList();
al.Add(new myClass("Peter"));
al.Add(new myClass("Mary"));
DataList1.DataSource = al;
DataList1.DataBind();
}
Answer : How to add Button control to DataList control
If(!IsPostBack)
{
BindGrid();
}
private void BindGrid()
{
ArrayList al = new ArrayList();
al.Add(new myClass("Peter"));
al.Add(new myClass("Mary"));
DataList1.DataSource = al;
DataList1.DataBind();
}
try this and let me know the status
Random Solutions
MS Virtual Machine and disk2vhd
access error 3799 when backup or compact and repair
How to show number of messages besides a folder
Issue Opening Excel File in MS Excel 2007 w/Embedded Links
MS Access calculate rolling 12 month average
Missing day no. when using FormatDateTime
warning LNK4089: all references to "WSOCK32.dll" discarded by /OPT:REF
Microsoft, Server 2003, SP2 Bugcheck 0x0000000a Problem
Difference between XmlDocument and XmlDataDocument in .NET
Am trying to get a MAS90 VI Job to run from WinExec(). Runs fine from command prompt, but not from WinExec().