Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. input array in ASP.net C#

input array in ASP.net C#

Scheduled Pinned Locked Moved C#
csharpasp-netdatabasedata-structureshelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Suman Singh
    wrote on last edited by
    #1

    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

    G K 2 Replies Last reply
    0
    • S 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

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Don't cross post. --- b { font-weight: normal; }

      1 Reply Last reply
      0
      • S 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

        K Offline
        K Offline
        Koushik Biswas
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups