I have seen examples of how to do this where the page does a postback to the server to update the Detail View.However, I would like the update to occur with a callback to the server.Details View server control is used to display, delete, insert or edit a single record from data source. More about Form View control you can read in Form View Control: Step by Step tutorial. After we created Sql Data Source control, we need to associate it with Details View control.Details View control is often used in master/detail scenario with Grid View control. To work with records, first we need to connect Details View control with some data source. You can do that in design view, like on next image: Also, you can do this if you set Data Source ID property of Details View control to the name of your data source control. Sql Data Source control above uses a database with Products and Categories tables.I am pretty new to ASP, and I have looked everywhere I can think of to find an example like this using callbacks. Does anyone know how to do this update using callbacks? The Details View needs to be reloaded after you have selected a row from the Grid View, so the page needs a post back.To do this, add a Control Parameter to the Details View, make sure it points to the Grid View by setting the Control ID attrbiute to the Grid View's Id.
The page reloads and the data is set back to the original. I'm using a Button to fire the Update Item event and then leaves the user a status stating that the event is updated, which does occur so i know the button is firing properly. Thanks David Lozzi " Select Command="SELECT * FROM [tbl Events] WHERE ([ID] = @ID)" Delete Command="DELETE FROM [tbl Events] WHERE [ID] = @ID" Insert Command="INSERT INTO [tbl Events] ([str Title], [str Description], [dt Date], [str Speaker], [str Host], [str Location], [str Address], [str City], [str State], [str Contact Name], [str Contact Title], [str Contact Phone], [str Contact Email], [str Notes], [dt Added], [dt Modified]) VALUES (@str Title, @str Description, @dt Date, @str Speaker, @str Host, @str Location, @str Address, @str City, @str State, @str Contact Name, @str Contact Title, @str Contact Phone, @str Contact Email, @str Notes, , )" Update Command="UPDATE [tbl Events] SET [str Title] = @str Title, [str Description] = @str Description, [dt Date] = @dt Date, [str Speaker] = @str Speaker, [str Host] = @str Host, [str Location] = @str Location, [str Address] = @str Address, [str City] = @str City, [str State] = @str State, [str Contact Name] = @str Contact Name, [str Contact Title] = @str Contact Title, [str Contact Phone] = @str Contact Phone, [str Contact Email] = @str Contact Email, [str Notes] = @str Notes, [dt Modified] = WHERE [ID] = @ID" Protected Sub btn Update_Click(By Val sender As Object, By Val e As System.
As when I assign updated Name to Label1 it displays the old product name value and not the one in the textbox.
But I can't see why it wouldn't be bringing back the new textbox values.
This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. By joining today you can post your own programming questions, respond to other developers questions, and eliminate the ads that are displayed to guests. When I click on the "Insert" link after filling in the Text Boxes from a Details View control, I would like my Grid View display to now include everything I had plus the new insertion "row" (after insertion, "re-visit" the specifiic table). Click the button below this post to show your appreciation!
NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions.