Results 1 to 4 of 4

Thread: Pass ID of selected dropdownlist value to controller

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Pass ID of selected dropdownlist value to controller

    if I have a dropdownlist and the user selects an item, I want to pass the item ID to a controller action from a Buttonactionlink

    how is this possible?

    using MVC 2.0 here.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Pass ID of selected dropdownlist value to controller

    Are you not posting a form?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Pass ID of selected dropdownlist value to controller

    Not sure if this example will be of use.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: Pass ID of selected dropdownlist value to controller

    thanks all.

    Well, the post will happen when the user clicks on the action button link. But I want the action button link to generate the link based on the id of the item in the dropdownlist so it posts to the correct page with the correct data i.e: /edit/user/1 - the "1" will be the ID from the dropdownlist the user has selected.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width