.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
Post New Web Links

Invalid postback or callback argument (using Cascading dropdown list controls)

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :ASP.Net
 

 Greets,

i use cascading dropdown lists (in a user registration form) and when the user hits the submit button i get the error:

"Invalid postback or callback argument"

 

I've seen on the net that this is a problem dating back many years but still haven't found a solution to this.

 I've read about changing EnableEventValidation to false, but this poses a security risk.

 

Anyone knows a good solution to this? (i'm coding in c#)

 

Thanks

 




View Complete Post


More Related Resource Links

How to CATCH "Invalid postback or callback argument" exception?

  

Hi,

How can I catch this exception? I do not want it to stop my page execution. Can/Should I do that?

Server Error in '/' Application.
________________________________________
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.
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 <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

Dropdownlist posted back html content,firefox alarms "Invalid postback or callback argument"

  

Ok probably you might have seem a dozens of post's titled "Invalid postback or callback argument" but this one is different.

Application that i am creating is simple content editor using the FCK editor.net Control (the content is HTML Encoded before saving t0 DB and then Decoded back again when displaying). just a simple drawing of of its ui is like this

DdlPages < listing the pages Whose regions/controls value can be edited> Databound

DdlRegions <listing the controls whose content can be edited> Databound on DdlPages selected index change

===========Retreived from DropDownlistRegions selected Index Change===========

txtName <a simple name for the region, user friedly identity >

==> FCK Editor <==

<Save Button> <Discard Button>

=================End===========================

I am not such a good designer but hope you understand the UI layout.

This thing works flawless on IE 6,7,8

Process:

DropdownlistRegions holds the content to be displayed in the txtName and FckEditor. This is done by forming a custom concatenated column containing the txtName and Fckeditor(HTML content) separated by a ' ^ ' character. and then databound the column to the Dropdownlist value property.

So on selected index chang

Invalid postback or callback argument in Web Site Administration Tool

  

I get the following when I try to manage access rules in the ASP.NET Web Site Administration Tool.  Does anybody have idea why this might be anf how to fix?

An error was encountered. Please return to the previous page and try again.

The following message may help in diagnosing the problem: 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 ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation. at System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) at System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at

System.ArgumentException: Invalid postback or callback argument.

  

Is there a good way to test and debug these errors.  I constantly get them emailed to me from my production site but I can not duplicate them.  Below is the entire error.


User: jbrown
IP: 74.202.255.133
Session[STUser] = DAL.stUser
Session[PlaylistName] = Adult Contemporary Holiday Blend 2010 (vol. 2)
Session[PlaylistId] = 3865
Session[SES-FAN] = SessionFan
Session[fullPreview] = yes
System.ArgumentException: Invalid postback or callback argument. Event validation is enabled using 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. at System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Exception of type 

Invalid postback or callback argument

  

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.

 

What does this error mean?

I get it sometimes when I click on this link button. Most of the time it works fine, but I am not able to figure what causes this error.

<asp:LinkButton ID="NewPatientButton" runat="server" OnClick = "AddNewPatient">Add New Patient</asp:LinkButton>

code behind:

protected void AddNewPatient(object sender, EventArgs e)
    {

        string RedirectURL = "Patient.aspx?First=" + PFirstName.Text +
                                " &Last=" + PLastName.Text +
                                " &Middle=" + PMiddleName.Text +
                                " &DOB=" + PDOB.Text +
                                " &MRN=" + PMRN.Text+
 

Invalid postback or callback argument

  

Hey Guys.

I'm having this wierd issue I hope you could help me with.

I have two drop down lists in my page, and an accordion.

When a value is chosen for the first DDl it loads specific values from my database into the second ddl.

I've put the second one inside an Update panel, and added the first DDL as AsyncTrigger, so whenever someone chooses a value from the first DDL it loads the second one without refreshing the page.

After a value has been chosen for the second DDl the accordion should be populated with data.

I've ran some tests and noticed that choosing a value from the second DDL won't populate the accordion, so I've added another PostBack trigger to the second DDL- the ddl itself.

Sometimes it works fine- I choose a value from ddl2 and the accordion shows fine, but sometimes I get this error message:

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 ClientScriptM

how to hide/display controls in NewForm.aspx based on dropdown value in SharePoint list

  

Hi,

I have 1 dropdown in my sharepoint list with other columns. If dropdown value equal to 'xyz' i need to display some other controls, otherwise these controls should be hidden.

I know we can achieve this with javascript. If any one can provide code or sample then it will be appreciated. or is there any other alternative methods to do this ........


Thanks & Regards, Neerubee

Multiple issues with dropdown list controls not working correctly

  

Overview
I am using WSS 3.0 and SharePoint Designer.  I have modified one of the items in my NewForm page so that I have a filtered lookup using a spdatasource. The filter works great, but my issue is that I can't seem to save the users selection back to the list itself.

Issue when using an ASP.NET dropdown list
I am able to bind the filtered spdatasource to an ASP.NET dropdown list control, however the item that is selected in the dropdown list is not being saved back to the list.  I am guessing that this is because the dropdown list itself is not tied directly to the appropriate list item, but... I can't seem to figure out how or where to do this.  I don't see anything in the data properties box in SharePoint Designer that allows me to tie the data back to the list itself.  Maybe I am just overlooking it somewhere?

Issue when using the native SharePoint Data View DropDownList with a filtered spdatasource
When I select "Data Fields..." on the dropdown control I get the Change Data Bindings dialog box.  From here I can select a data field to save the value back to (which resolves the issue noted for the asp.net control) and I can select my spdatasource, but... the display text and value fields below that never populate.  Thus, the dropdown list is empty when the user is filling ou

Cascading Dropdown list boxes

  

Hi,

I'm developing a Browser-enabled InfoPath 2007 form which uses code. I have a requirement to get infomation from a sharepoint list column and populate in the 1st drop down list. Depending on the users selection on the 1st drop down, need to populate the 2nd list which will get data from the same list from a different column. BAsically filter data from the first selection.

I got to know that filtering data with out code is not possible in browser-enabled web forms. Is there a work-around for this ? Can the lists be populated using code ?

Thanks in advance !


stop postback if selected value in dropdown list = No

  

Hi All,

I want to stop postback if a certain value from a ddl is selected.

I've used VB to create a page whereby if a certain value from a ddl is selected then a hidden panel becomes visible. The problem is the likely answer to a majority of my ddl's is 'No' (or a no type response), however, even though the panel visibility remains false upon selecting No a postback still occurrs, the page refreshes and moves back to the top. I suppose this is a question with 2 possible solutions (or 2 questions rather)

1: Is there anyway of setting postback to false if selected value = No? A typical example of how my code appears is below

    Protected Sub ddlYesNo_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlYesNo.SelectedIndexChanged
        If ddlYesNo.SelectedValue = ("1") Then
            panel3Days.Visible = True
            PanelWhoWasInjured.Visible = True
        Else
            panel3Days.Visible = False
            PanelWhoWasInjured.Visible = False
        End If
        radbut3DY.Focus()
    End Sub

(i've used the value '1' to represenet Yes)

2: Is there a way of setting the page position after postback? As you can see in my code above i've set the focus on the next control (being a Radio Button) but i mean, is there

Cascading DropDown List & RadioButton in ModalPopup Extender

  

I need help to integrate all of those control in asp.net page. I am using the newest AJAX control toolkit. What I want to accomplish is I have a modal popup panel with cascading dropdown list and radio button inside. The issue is the postback. RadioButton and Cascading dropdown have postback so that will cause the modal panel disappear after the postback. I just want the panel disappear after I click the ok button on the panel and send the data into a field in a page. What I did was I placed the update panel inside the popup panel. If I did that, I would see the dropdown lists automatically refresh every time by accessing the webservice. If I placed the update panel outside, the dropdown would not be triggered. Even I set the trigger for the Update Panel, it will not see that way.


Cascading dropdown list in content type?

  
Hi all

I use content types on my document library.
The content types have two choice fields, "Process" and "Sub process". Selecting a process should show me the relevant sub processes for the selected process.

Any ideas on how I can achieve that?

Regards

Dropdown list in ASP.NET - How to get value selected

  
am sure this must be very simple, but unforunately I can't figure it out.
I have the following code which populates the dropdown lists from the database. This works fine. Now, when the user selects a particular employee name from the list, I want to get the Employee Id of the selected employee. i.e. I need to get the "Eid" value. I can do this if the EId is loaded in the dropdown list, but in this case only the employee name is displayed. Please let me know howI can get the Eid value even though it is not loaded in the dropdown list.
I would really appreciate your help

Editable Gridview with Textbox, CheckBox, Radio Button and DropDown List

  
This is an example of an editable gridview containing different ASP.NET controls. When user wants to edit values in gridview, she/he can use these controls to edit existing values in Gridview Edit Mode.

Using the Code

Binding an array to dropdown list

  

I have the following string which is a list of urls. How do I get this to work so the url shows for the selection and also is the value?      

 

allLinks = newAllLinks
        Me.DropDownList1.Items.Clear()
        Me.DropDownList1.DataTextField = "Link"
        Me.DropDownList1.DataValueField = "LinkURL"
        Me.DropDownList1.Items.Insert(0, New ListItem(" - Select - ", 0))
        Me.DropDownList1.DataSource = allLinks
        Me.DropDownList1.DataBind()


 

 ArgumentNullException: Value cannot be null.
Parameter name: container]
   System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +121
   System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName, String format) +8
   System


Gridview with a dropdown list for editing

  

Hello. I am working through Scott Mitchell's ASP.Net in 24 hours book. I am finishing the photo album project.

I have a GridView that retrieves a list of uploaded photo rows for the logged-in user.
The GridView is for editing and deleting rows.

The photo Category field in the Gridview is a dropdown list. The text entry field was deleted after converting this field to a Template.

Like the uploaded photos, these Categories are user-specific. They are created in another web page.

Users also have the option to select "none" for the category when they upload an image.

For the GridView:  The Category ID field's ItemTemplate and EditItemTemplate both have a " - None - " choice added to them.

I am getting this error:

'pictureReadOnlyCategories' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value

 

Note: The ID for the ItemTemplate for that dropdown list is the ID listed above in the error: "pictureReadOnlyCategories".

 

Am I missing some step in this process of changing a GridViews text field to a dropdown that can be used for editing? I went through the book's instructions three times.


Here is my code for the dropdown list and a screenshot of the Design

Populating Dropdown List using FK

  

Hi Folks,

2 Questions. I am trying out Data Entities in VWD 2010 Express. I have a parent (Customers) and child (Orders) table. Customers table has FirstName, LastName and Email columns.

Q1. When I view/edit/insert an Order, it shows the customer's first name in dropdown list whereas I want the full name. How can this be done?

Q2. How can I change the default behavior of PK/FK relationship so that customer's Email is displayed instead of Name?

Any help will be much appreciated.

Cheers


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend