Click here to Skip to main content
11,715,022 members (66,591 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MVC3 MVC4
hello every one..

i have facing problem related to dropdownfor in MVC4.
i have a page "Index.cshtml". on this page i have one dropdownlist and one button named "btnDdl".
i have open a popup window "popupwindow.cshtml" on button click.
On popupwindow.cshtml i have one textbox and one button named "btnText".
i want to add textbox value(witch entered by user) into dropdownlist when clicked on button (btnText) and open popup window closed.

thanks
Posted 2-Nov-12 5:22am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

1) Do these two views share the same ViewModel? If so then you can add the applicable values to the ViewModel and use that model to get the data back and forth.
2) If these two views use different ViewModels, you can add the values in question to each ViewModel and then use controller code to transfer the value from one model to the other.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 530
1 Richard MacCutchan 275
2 Maciej Los 259
3 ManasKumarM 155
4 Frankie-C 115
0 Sergey Alexandrovich Kryukov 775
1 CHill60 415
2 Richard MacCutchan 405
3 Maciej Los 389
4 OriginalGriff 320


Advertise | Privacy | Mobile
Web02 | 2.8.150901.1 | Last Updated 2 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100