Results 1 to 5 of 5

Thread: [RESOLVED] Passing value from View to View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    India, Kerala, Calicut
    Posts
    242

    Resolved [RESOLVED] Passing value from View to View

    Can we pass Boolean values from one to another view...

    I think its possible but not getting any idea how to...

    please help me out....

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

    Re: Passing value from View to View

    Since when does one view talk to another, unless one is a partial? A view is displayed by a controller action, so any data the view receives comes from that action. If data needs to come from a previous view then that previous view needs to pass that data to the action, which it does via the URL in a get or the model in a post.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    India, Kerala, Calicut
    Posts
    242

    Re: Passing value from View to View

    Yeah. Thank you jmcilhinney. I didnt know that we can pass multiple values to controller from view. Here i already was passing value to controller. Now am passing one more value as Boolean so its working...once again thanks..

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: [RESOLVED] Passing value from View to View

    The controller can pass as much data as it wants to the view. The model is just one object but it can be any object you want, i.e. it can contain as much data as you want. It could be a collection of DataSets that each contains hundreds of DataTables if you wanted. You've also got the ViewBag, which can pass as many objects as you like. Some people don't believe in using the ViewBag at all but rather passing everything via the model, defining a new type for the purpose if required. Personally, I think that the model should be used to pass all the application data for display or editing while the ViewBag should be used for metadata.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    India, Kerala, Calicut
    Posts
    242

    Re: [RESOLVED] Passing value from View to View

    Yeah..whenever i googled and search on many forums, its all showing examples with single parameter thats why i got stuck.

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