input array in ASP.net C#
-
Hi all, I need to make input array in asp.net using C#... the data is comming from database as:id, name, position the form should display like this... posiotion will be in textbox.. name position aa 1 bb 2 cc 3 button(Set Position) now user can alter the position of names and when click on button, all records should be updated with new position values... for this I want to make two input arrays like: how can i set the database values to the textboxes and again fetch them in C# to update records with the new values entered by user... any help will be very much appreciated.. Thanks in advance... Suman Singh
-
Hi all, I need to make input array in asp.net using C#... the data is comming from database as:id, name, position the form should display like this... posiotion will be in textbox.. name position aa 1 bb 2 cc 3 button(Set Position) now user can alter the position of names and when click on button, all records should be updated with new position values... for this I want to make two input arrays like: how can i set the database values to the textboxes and again fetch them in C# to update records with the new values entered by user... any help will be very much appreciated.. Thanks in advance... Suman Singh
-
Hi all, I need to make input array in asp.net using C#... the data is comming from database as:id, name, position the form should display like this... posiotion will be in textbox.. name position aa 1 bb 2 cc 3 button(Set Position) now user can alter the position of names and when click on button, all records should be updated with new position values... for this I want to make two input arrays like: how can i set the database values to the textboxes and again fetch them in C# to update records with the new values entered by user... any help will be very much appreciated.. Thanks in advance... Suman Singh
Assuming that you are using the "codebehind" coding style (which is the recommended way) - your CS file linked to your ASPX page will have a class in which the textboxes representing positions (visible ones) as well as the textboxes representing the id-s (invisible ones) should have corresponding "protected" members (of type TextBox). If you do not see any, that may be because you are using the "non-ASP.NET" control "input". Instead, if you use the ASP.NET control TextBox (drag and drop them on your aspx form using the toolbar), the corresponding CS class objects will get auto generated. That said, there is still way to continue using the HTML "input" controls and represent them in your CS file with corresonding TextBox members - in that case you have to declare the TextBox objects in your CS file by yourself. All this because you need those CS objects to do what you are trying to do. Once you have them - then in Page_Start, if PostBack is false (first time) - just set the texts of the textboxes with the database values, and if PostBack is true (after Set Position button is clicked) - pick them up and execute your update query. That's it! And yes, this is indeed cross posting. Koushik Biswas