locked
Need to Capture Data from Gridview and Load Gridview on Another Page RRS feed

  • Question

  • User564995064 posted

    My application allows users to request an account.  They have to choose an institution, program and role.  In some instances, users will need to have access to multiple institutions.  On the user request page, it has a button redirecting to a page where they chose the institution.  The on_change loads a grid with the program and roles available at that institution.  Once they chose the roles for each program, they click a continue button.  I want to capture the institution, program and roles for each program and pass it back to the main page, loading it into a gridview which is not editable.  They can then choose to add another institution (which redirects to the other page and so on) or submit the request.  My issue is how to capture ALL of the information on the original grid and pass it to a static gridview on the main page.  The static gridview will have the institution name, program name and role requested.  This information will be passed to my insert procedure on the submit button click event.

    At this point, I do not know if my code would be helpful.  If so, I can add it.  What I am looking for first is to see if this can be done and how I might do it.  Or, if there is a better way, I am all ears.  :)

    Thank you.

    Thursday, May 11, 2017 4:01 PM

Answers

All replies

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 15, 2017 2:15 AM
  • User564995064 posted

    Hey Cathy,  thanks for your reply.  I was going to use session variables, however, there could be 1-6 programs depending on the institution they choose.  For instance, if they choose an institution and sets their roles for 4 programs, I need to pass all 4 rows of data back to the main page grid view.  Then if they choose another institution that has 6 programs, I need to pass the roles for all 6 rows back to the main page grid view and put those rows underneath the 5 that are already there.  I have no way of knowing exactly how many rows will be needed so I am not sure how to initialize or set the session variables.

    Make sense?

    Rhonda

    Monday, May 15, 2017 2:22 PM
  • User475983607 posted

    rhondadunn

    On the user request page, it has a button redirecting to a page where they chose the institution.  The on_change loads a grid with the program and roles available at that institution

    Also assign the institution Id to a hidden field when the request page loads.  

    rhondadunn

    Once they chose the roles for each program, they click a continue button. 

    Assuming these are checkbox inputs... Assign the role Id to the value property of the checkboxes when the grid is rendered.  From here it is a simply matter of reading the POST parameters when the form is submitted.  The hidden field will contain the institution Id and the checkbox will contain a comma separated list of roles.  

    It is not clear what a program is and if there is a one-to-many relationship with roles...

    I suggest that you learn basic HTML forms which will make coding this much easier.  Sometimes ASP Web Form developers get lost in the server controls and ASP state management which complicated the design.  Go back to the basics for how parameters are submitted to the web page.

    Monday, May 15, 2017 2:51 PM