[MVC] How to use partial view twice in same view?

  1. #1

    [MVC] How to use partial view twice in same view?

    I have an "Edit User" Panel, and an "Add User" Window. I want both to display the same FormPanel, which I have defined in Views/Shared/_UserForm.cshtml

    Click image for larger version. 

Name:	Untitled.png 
Views:	199 
Size:	66.0 KB 
ID:	5111

    Right now I am displaying the partial view in the "Edit User" section by doing

    viewportItems.Add(Html.X().FormPanel()
        .ItemsFromPage(this, "~/Views/Shared/UserForm.cshtml"));
    However when I try to use ItemsFromPage again to add it to the window, I get the error

    An item with the same key has already been added.
    So, how can I add the same partialview to my main view twice?
  2. #2
    Still trying to work on this. Please help.
  3. #3
    I guess you need to avoid any ID in that partial view
  4. #4
    You're right! I commented out the IDs and it works now. Thank you.
    Last edited by KBorkiewicz; Nov 19, 2012 at 7:19 PM.
  5. #5
    Desktop control seems to bypass ID problem, when IDs are in different desktop modules.
    But how to use partial views with single desktop modules in partials and how to render them inside Desktop? How to render them with a controller?

    Any MVC sample of the Desktop partial implementation is planned?

    I need it for the same ID question.

    Thank you.

Similar Threads

  1. [MVC] How to use a partial view in a window?
    By KBorkiewicz in forum 2.x Help
    Replies: 7
    Last Post: Nov 21, 2012, 11:11 PM
  2. [CLOSED] Partial View With Linked Combos
    By rbarr in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Sep 05, 2012, 12:26 PM
  3. [CLOSED] [2.1] MVC Partial View
    By softmachine2011 in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 23, 2012, 12:04 PM
  4. Javascript not work in partial view mvc.ext.net
    By theblackcat_2902 in forum 1.x Help
    Replies: 9
    Last Post: Aug 24, 2011, 10:31 AM
  5. [CLOSED] RegisterOnReadyScript in MVC partial view
    By SandorD in forum 1.x Legacy Premium Help
    Replies: 22
    Last Post: Aug 10, 2011, 4:17 PM

Tags for this Thread

Posting Permissions