locked
MVC4 Using a Multi-Field Primary Table Key with a Webgrid Containing Checkbox RRS feed

  • Question

  • Hi,

    I’m brand new to MVC4 development and didn’t see a priority forum related to ASP.NET MVC4 applications. So, I’m asking my question here. I was following a tutorial on selecting and deselecting checkboxes inside a Webgrid. The example could be found at:

    http://dotnetawesome.blogspot.com/2014/07/selecting-deselecting-all-checkboxes-inside-webgrid-mvc4.html

    I was able to use this example to create an application that used a table from my SQL 2012 database. Where the example at the link above uses a table that has a single field primary key, my primary key is made up of 4 fields. Using the primary key, if possible, I need to be able to identify which records have checkboxes selected, no matter how the table is sorted. These records will be modified and updated in the database.

    Looking at the table using Management Studio, I see that the primary key has a name of the form PK_tablename. Is there a way to use the name of the primary key the same way the example uses the single field name? If not, is there some type of index number or unique record identifier that I could get using the primary key? An example of how to do it or a link to sample code would be appreciated.

    Friday, May 8, 2015 5:17 PM

Answers

  • Hi SoulSearching,

    Actually this forum is to discuss the VS usage issue, if this issue is related to web development, you could ask this question in the ASP.NET forum: http://forums.asp.net. If then, you could get an answer more quickly and professional. Thanks for your cooperation.

    Best Regards,

    Jack 


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Just Karl Friday, May 22, 2015 10:05 PM
    • Marked as answer by Just Karl Friday, May 29, 2015 4:18 PM
    Monday, May 11, 2015 9:36 AM

All replies

  • Hi SoulSearching,

    Actually this forum is to discuss the VS usage issue, if this issue is related to web development, you could ask this question in the ASP.NET forum: http://forums.asp.net. If then, you could get an answer more quickly and professional. Thanks for your cooperation.

    Best Regards,

    Jack 


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Just Karl Friday, May 22, 2015 10:05 PM
    • Marked as answer by Just Karl Friday, May 29, 2015 4:18 PM
    Monday, May 11, 2015 9:36 AM
  • Jack, thanks for steering me to the right forum. I'll repost there.
    Monday, May 11, 2015 11:40 AM