473,383 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Using Edit Command Gridview

Hi everybody,

I am not familiar using Gridview, I created a Gridview with Edit Command
Button, but when I click the update Command button this error message below
is displayed, what and where is the problem? I am confused. Can anyone show
me exactly to do edit process of Gridview using Edit Command button properly?
Thanks.

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 ClientScriptManager.RegisterForEventValidation method in
order to register the postback or callback data for validation.

Expand|Select|Wrap|Line Numbers
  1. protected void gdvLinks_RowEditing(object sender, GridViewEditEventArgs e)
  2. {
  3. gdvLinks.EditIndex = e.NewEditIndex;
  4. for (int x = 0; x < gdvLinks.Columns.Count; x++)
  5. {
  6. gdvLinks.Columns[x].Visible = true;
  7. }
  8. gdvLinks.DataSource = dtLinks;
  9. gdvLinks.DataBind();
  10. }
  11.  
  12. protected void gdvLinks_RowUpdating(object sender,
  13. GridViewUpdateEventArgs e)
  14. {
  15. gdvLinks.EditIndex = -1;
  16. LoadLinkGrid();
  17. }
  18.  
  19. //Loading datasource not using SqlDatasource control
  20. private void LoadLinkGrid()
  21. {
  22. gdvLinks.DataSource = dtLinks;
  23. gdvLinks.DataBind();
  24. }
  25.  
  26.  
--
MCP Year 2005, Philippines
Oct 9 '06 #1
0 6020

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: fatmosh | last post by:
I have a GridView that is pulling data from a SQL database using a Select command. I would like to use GridView's built-in "Edit, Update, Cancel" functionality because it is very handy. However,...
6
by: ibiza | last post by:
Hi all, I have a gridview that can edit data, which is bound to an sqldatasource. Everything works fine, I can update the data via an Edit Command field. However, there are some textboxes in...
3
by: misiek | last post by:
Hi all. I have following problem: 1. In my web page I have a GridView control, which does not have a DataSourceId set in designer. 2. When user presses Start button then I create...
0
by: Sam | last post by:
I am fairly new to ASP. Net 2.0, background MS Access 2000/2003 and working knowledge of SQL 2000. Scenario: Page1: Blank Page loads with 2 Text Boxes (TxtLast, TxtFirst), a Command...
1
by: HemaSMD | last post by:
i am trying to use gridview to display and edit data. i am using stored procedures in select command and update command of sqldatasourrce. i m trying to use session parameter which works well for the...
1
by: sheenaa | last post by:
Hello Members, I m creating my application forms in ASP.Net 2005 C# using the backend SQL Server 2005. What i have used on forms :: ? On my first form i have used some...
1
by: savajx1 | last post by:
I need to dynamically create a set of bound fields contained in a GridView control. I also have a single static CommandField that I can declare in the Columns <tagof the GridView control. I have...
0
by: lamolap | last post by:
i have 1 gridview , a dropdownlist inside a gridview and a commandfield of (edit, update and cancel) my gidview looks like this Edit Surname Initials ...
2
by: DC | last post by:
Hi, I am using a GridView to present data in a DataTable, which I store only in ViewState and when the user hits the "OK" button the rows in the DataTable will be used to execute transactions. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.