ASP.NET MVC partial rendering

Page 1 of 2 12 LastLast
  1. #1

    ASP.NET MVC partial rendering

    Hi!
    I need to add .ascx control (with ext.net controls) to some page. I implemeted it by creating panel with autoload. It works, but this control starting to render after page was loaded, so there are one additional request to server. How to render my control during main page render, like HtmlHelper does?
  2. #2
    Anyone please?
  3. #3
    Hi,

    This way:
    <ext:Panel ID="Panel1" runat="server">
        <Content>
            <%= Html.RenderExtPartial("Partial/View") %>
        </Content>
    </ext:Panel>
  4. #4
    Many thanks, Daniil! It's exactly what I needed.
  5. #5
    Can you please provide example of using Html.RenderAction + Ext.Net.MVC.PartialViewResult?
  6. #6
    Please clarify the requirement. What exactly are you trying to achieve?
  7. #7
    I want to render my .ascx user controls (with Ext.Net controls on it) during main page render, not via autoload.
    Html.RenderExtPartial do the trick, but it ruins MVC paradigm in case if you want to pass some model to view. So I want to use Html.RenderAction, which accepts controller method as argument. The problem here is Ext.Net controls refusing to render correctly via this method.
  8. #8
    Well, you can pass a model to the RenderExtPartial method.
    http://forums.ext.net/showthread.php?10413
  9. #9
    Yes, that's the way I implemented it for now. But after doing so we have view, which renders partial view within itself and passing completely different model to it, bypassing controller. It works, of course, but it is wrong in MVC I think.
  10. #10
    Quote Originally Posted by wdk View Post
    passing completely different model to it
    Could you clarify it with a sample?
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] Problem rendering partial view
    By T3rryChan in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 03, 2012, 9:22 PM
  2. [CLOSED] rendering desktop windows using partial view
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Jan 11, 2012, 6:42 PM
  3. [CLOSED] Dynamically Added Tab not rendering partial view
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 13
    Last Post: Apr 26, 2011, 9:10 PM
  4. Partial postback
    By hardik in forum 1.x Help
    Replies: 0
    Last Post: Apr 12, 2011, 1:53 PM
  5. Partial Postbacks in a Viewport
    By westerncape1000 in forum Open Discussions
    Replies: 2
    Last Post: Jul 17, 2008, 3:44 AM

Tags for this Thread

Posting Permissions