Formview itemupdating event
When you execute your web page, Details View control renders an HTML table.
The Details View supports both declarative and programmatic databinding.
To get the datakey value of the selected record of the Details View control, we need to set the Data Key Names property of the Details View control. " Select Command="SELECT * FROM Sample" Update Command="Update SAMPLE SET [email protected],[email protected] Where [email protected]" Delete Command="Delete SAMPLE Where [email protected]" Insert Command="Insert SAMPLE(Code, Name,description) VALUES(@Code,@Name,@description)" runat="server"/ When the page index of the Details View control is changed, the Page Index Changed event is fired.
This property should be assigned with the Primary Key of the database table. We cannot retrieve the datakey values as the data is not yet bound to the details View control.
You select the record from master control (as example Grid View) and selected record is displayed in Detail View control.
In general Grid View control displays more than one record, but the Details View control displays single record from database table.
Inside these events, you can use Find Control to find the file upload control and work from there. when this button is clicked and file for that corresponding row is browsed, write this code in Form View1_Item Inserting(not Form View1_Item Inserted): string arg = e. To String(); // arg will contain the Id from the database for corresponding row if (File Upload1.
Hope this helps, Imar --------------------------------------- Imar Spaanjaars quickdoc=414 Hope this helps, Imar --------------------------------------- Imar Spaanjaars , thatswhy i am not able to bind the file upload control to image field.i have not used any code for file uploader if you think that this method is wrong can you tell me another method to do it i know that i am asking too much but i would greatfull to u tell me preferably in c# thankyou Data Source ID="Sql Data Source1" Style="z-index: 100; left: 32px; position: absolute; top: 88px" Height="368px" Width="560px" Back Color="#DEBA84" Border Color="#DEBA84" Border Style="None" Border Width="1px" Cell Padding="3" Cell Spacing="2" Grid Lines="Both" On Item Inserted="Form View1_Item Inserted" On Item Updated="Form View1_Item Updated" On Item Deleted="Form View1_Item Deleted"Hi rakuntal, My article mainly helps you with writing the code for saving and retrieving files from the database. To mix those concepts with controls like the Form View, you need to look into some basic Data Control Tutorials: Star...a/ particular, search Google for more information about handling the Item Inserting and Item Updating events. NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004 to linkbutton "Insert Button". ;) Imar --------------------------------------- Imar Spaanjaars This will help others answer the question without having to ask. 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.Registration is fast, simple and absolutely free Friends..I am new to asp.net2.o world & trying my hands here & there, when trying i find utility of using server controls in formview very the problem is this that when i tried to use fileupload control in formview insert item template, that is not working, i am trying to upload a image file in my data folder as well as in data table. i have tried it lot in net but no success plz help me,if u can give me full code or method of solving my problem thank you friends First of all, datatype of image cannot be varchar. Or, you can store the path of image file in database table. NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004hi gaurav, first of all thanks to reply.Tags: Adult Dating, affair dating, sex dating