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. Web Development
  3. ASP.NET
  4. Regarding MVC View

Regarding MVC View

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netjavascriptlinqarchitecture
4 Posts 2 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.
  • T Offline
    T Offline
    Tiger456
    wrote on last edited by
    #1

    Hi, As i am newbie to asp.net mvc i would like to know the best practices to solve below scenario. In a user profile page i have list of interest. These data is populated from "Interest" table. Which should be displayed as below. Name : [ Text box ] ....

    Interest:

    Interest 1 O Yes O NO
    Interest 2 O Yes O NO
    Interest 3 O Yes O NO
    Interest 4 O Yes O NO

    ..... Where Yes/No is option button, Where user can select interest. While submitting these values need to be stored in "User_Interest" table. where values in other controls are stored values in "User" table. Technologies using : MVC,Jquery, Linq My Questions are: 1. How to use same view for Create/Edit 2. How to identify and save selected interests 3. How to set previously selected Interest while editing. 4. best way to create view model. If you can point me similar examples that would be great. Thanks in advance

    N 1 Reply Last reply
    0
    • T Tiger456

      Hi, As i am newbie to asp.net mvc i would like to know the best practices to solve below scenario. In a user profile page i have list of interest. These data is populated from "Interest" table. Which should be displayed as below. Name : [ Text box ] ....

      Interest:

      Interest 1 O Yes O NO
      Interest 2 O Yes O NO
      Interest 3 O Yes O NO
      Interest 4 O Yes O NO

      ..... Where Yes/No is option button, Where user can select interest. While submitting these values need to be stored in "User_Interest" table. where values in other controls are stored values in "User" table. Technologies using : MVC,Jquery, Linq My Questions are: 1. How to use same view for Create/Edit 2. How to identify and save selected interests 3. How to set previously selected Interest while editing. 4. best way to create view model. If you can point me similar examples that would be great. Thanks in advance

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      I think you are getting confused by the technology. It isn't that difficult. There are many examples that show how to exchange data between controllers and views, what research have you done so far? Have you looked here, http://www.asp.net/mvc[^]?


      I know the language. I've read a book. - _Madmatt

      T 1 Reply Last reply
      0
      • N Not Active

        I think you are getting confused by the technology. It isn't that difficult. There are many examples that show how to exchange data between controllers and views, what research have you done so far? Have you looked here, http://www.asp.net/mvc[^]?


        I know the language. I've read a book. - _Madmatt

        T Offline
        T Offline
        Tiger456
        wrote on last edited by
        #3

        Hi Mark, Thanks for your reply. I just stepped into MVC 1 day before for a project that needs quick completion. In the mean time i am trying to learn it in-depth. Yes i am little bit confused on the approach on Radio button list scenario in MVC not on how view and controller works. I like the approach in below link. http://robtennyson.us/post/2009/03/08/ASPNET-MVC-Default-Model-Binder-with-Lists.aspx[^] But haven't had got a clear idea on gathered these information on a jquery(on button click) and pass to controller as ajax call. In the controller Add newly selected item .. and delete old item View -- JQuery -- Controller Hope you got my scenario

        N 1 Reply Last reply
        0
        • T Tiger456

          Hi Mark, Thanks for your reply. I just stepped into MVC 1 day before for a project that needs quick completion. In the mean time i am trying to learn it in-depth. Yes i am little bit confused on the approach on Radio button list scenario in MVC not on how view and controller works. I like the approach in below link. http://robtennyson.us/post/2009/03/08/ASPNET-MVC-Default-Model-Binder-with-Lists.aspx[^] But haven't had got a clear idea on gathered these information on a jquery(on button click) and pass to controller as ajax call. In the controller Add newly selected item .. and delete old item View -- JQuery -- Controller Hope you got my scenario

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          If something this simple confuses you,

          <%= Html.RadioButton("model.Value", "RadioBtn", true) %>

          I'm sorry for the client. http://haacked.com/archive/2008/07/29/super-simple-mvc-ajax-with-jquery-demo.aspx[^]


          I know the language. I've read a book. - _Madmatt

          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