Click here to Skip to main content
15,925,369 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionError:Value cannot be null. Parameter name: dataSet.., Pin
Member 38798818-Aug-07 21:53
Member 38798818-Aug-07 21:53 
AnswerRe: Error:Value cannot be null. Parameter name: dataSet.., Pin
S A R I T H8-Aug-07 22:29
S A R I T H8-Aug-07 22:29 
GeneralRe: Error:Value cannot be null. Parameter name: dataSet.., Pin
Member 38798818-Aug-07 22:33
Member 38798818-Aug-07 22:33 
Questionhow t ochange the postions of sever controls . Pin
santoshkumarB8-Aug-07 21:41
santoshkumarB8-Aug-07 21:41 
AnswerRe: how t ochange the postions of sever controls . Pin
Sandeep Akhare8-Aug-07 22:29
Sandeep Akhare8-Aug-07 22:29 
QuestionProblem in Including Files Pin
cometburn0078-Aug-07 21:41
cometburn0078-Aug-07 21:41 
AnswerRe: Problem in Including Files Pin
Sandeep Akhare8-Aug-07 22:26
Sandeep Akhare8-Aug-07 22:26 
Questionevent validation error after creating datagrid bound columns programmatically Pin
Anees Mitha8-Aug-07 21:29
Anees Mitha8-Aug-07 21:29 
Hi All,

I am programmatically creating a datagrid bound columns (in ASP.NET 2.0). During initial page load there is no problem but after the postback i am getting following error.

Error Start --------------
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.
Error End --------------

I know that in order to avoid event validation we can set the following parameters in the config file.

enableEventValidation="false" validateRequest="false"

but since there can be a risk of a hole in the security i do not want to go with that.

Hence i am using the following code to register my event during page render stage.

protected override void Render(System.Web.UI.HtmlTextWriter e)
{
foreach (Control control in this.Controls)
{
Page.ClientScript.RegisterForEventValidation (control.UniqueID);
}

foreach (DataGridItem grdRow in grdvwCheckbox.Items)
{
Page.ClientScript.RegisterForEventValidation(grdRow.Cells[0].UniqueID);
}

base.Render(e);
}

Since i am getting following error in the trace.

Error Start--------------
[ArgumentException: 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.]
System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +2080220
System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) +106
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +32
System.Web.UI.WebControls.Button.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) +5102
Error End -------------

I suppose that there is a problem with the item command buttons in the datagrid (Cell[0]). Hence i am registering those buttons also but still i am getting the error message.

I also have 2 hidden fields but since i am registering all the controls guess that should not create any problem.

Please let me know where am i going wrong.

Regards,
Anees
QuestionProblem with datagrid link Pin
S A R I T H8-Aug-07 21:19
S A R I T H8-Aug-07 21:19 
AnswerRe: Problem with datagrid link Pin
cometburn0078-Aug-07 21:29
cometburn0078-Aug-07 21:29 
AnswerRe: Problem with datagrid link Pin
N a v a n e e t h8-Aug-07 21:29
N a v a n e e t h8-Aug-07 21:29 
GeneralRe: Problem with datagrid link Pin
S A R I T H8-Aug-07 22:11
S A R I T H8-Aug-07 22:11 
GeneralRe: Problem with datagrid link Pin
N a v a n e e t h8-Aug-07 22:44
N a v a n e e t h8-Aug-07 22:44 
GeneralRe: Problem with datagrid link Pin
S A R I T H9-Aug-07 0:19
S A R I T H9-Aug-07 0:19 
QuestionHow to upload local text file to remote server.. using ftp Pin
dhulipudi8-Aug-07 21:12
dhulipudi8-Aug-07 21:12 
AnswerRe: How to upload local text file to remote server.. using ftp [modified] Pin
KernowMan8-Aug-07 22:31
KernowMan8-Aug-07 22:31 
AnswerRe: How to upload local text file to remote server.. using ftp Pin
shweta@syscom8-Aug-07 22:51
shweta@syscom8-Aug-07 22:51 
GeneralRe: How to upload local text file to remote server.. using ftp Pin
dhulipudi9-Aug-07 0:23
dhulipudi9-Aug-07 0:23 
QuestionGetting a page variable value after the post back in Page_Init stage without using session and cookie Pin
Anees Mitha8-Aug-07 21:02
Anees Mitha8-Aug-07 21:02 
AnswerRe: Getting a page variable value after the post back in Page_Init stage without using session and cookie Pin
Vasudevan Deepak Kumar8-Aug-07 21:05
Vasudevan Deepak Kumar8-Aug-07 21:05 
GeneralRe: Getting a page variable value after the post back in Page_Init stage without using session and cookie Pin
Anees Mitha8-Aug-07 21:09
Anees Mitha8-Aug-07 21:09 
GeneralRe: Getting a page variable value after the post back in Page_Init stage without using session and cookie Pin
N a v a n e e t h8-Aug-07 21:15
N a v a n e e t h8-Aug-07 21:15 
GeneralRe: Getting a page variable value after the post back in Page_Init stage without using session and cookie Pin
Anees Mitha8-Aug-07 21:40
Anees Mitha8-Aug-07 21:40 
GeneralRe: Getting a page variable value after the post back in Page_Init stage without using session and cookie Pin
Anees Mitha8-Aug-07 23:52
Anees Mitha8-Aug-07 23:52 
QuestionRemember Me Next Time in Login Cotrol(ASP.Net 2.0) Pin
Chinnis8-Aug-07 21:00
Chinnis8-Aug-07 21:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.