[CLOSED] RenderSection to Ext.Net Control

  1. #1

    [CLOSED] RenderSection to Ext.Net Control

    Hello,

    Is there a way to render a section to an ext.net control. I would like to create a viewport with panels on my layout page and include "RenderSection" functions for each panel.

    Thanks.
    Last edited by fabricio.murta; May 24, 2016 at 7:42 PM. Reason: no user feedback for 7+ days
  2. #2
    Hello @edip!

    We'd appreciate if you left here the question and then posted the answer you found by yourself as that would potentially be useful for other users, if you don't mind.

    But we're glad you found the answer for your problem no matter what was it!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hi Facricio,
    Sorry, I found the "ContentFromSection" method, but i am having no luck in implementing it...

    The following is my layout page...

    	@Html.X().ResourceManager().CleanResourceUrl( true ).ShowWarningOnAjaxFailure( false ).AjaxTimeout( 130000 );
    
    	@(
    		X.Viewport ( )
    			.Layout ( Ext.Net.LayoutType.Border )
    			.ID ( "OutlookViewport" )
    			.ItemID ( "OutlookViewport" )
    			.Items
    			(
    				X.Panel ( )
    					.Region ( Ext.Net.Region.North )
    					.ItemID ( "NorthRegion" )
    					.Height ( 178 )
    					.Border ( false )
    					.ContentFromSection ( this , "NorthRegion" , false )
    				, X.Panel ( )
    					.Region ( Ext.Net.Region.West )
    					.ItemID ( "WestRegion" )
    					.Split ( true )
    					.Resizable ( false )
    					.Collapsible ( true )
    					.Collapsed ( false )
    					.Layout ( Ext.Net.LayoutType.Fit )
    					.ContentFromSection ( this , "WestRegion" , false )
    				, X.Panel ( )
    					.Region ( Ext.Net.Region.Center )
    					.ItemID ( "CenterRegion" )
    					.Split ( true )
    					.Header ( false )
    					.Layout ( Ext.Net.LayoutType.Fit )
    					.ContentFromSection ( this , "CenterRegion" , false )
    				, X.Panel ( )
    					.Region ( Ext.Net.Region.East )
    					.ItemID ( "EastRegion" )
    					.HideMode ( Ext.Net.HideMode.Display )
    					.Collapsible ( true )
    					.Split ( true )
    					.Layout ( Ext.Net.LayoutType.Fit )
    					.ContentFromSection ( this , "EastRegion" , false )
    				, X.Panel ( )
    					.Region ( Ext.Net.Region.South )
    					.ItemID ( "SouthRegion" )
    					.HideMode ( Ext.Net.HideMode.Display )
    					.Collapsible ( false )
    					.MaxHeight ( 20 )
    					.Split ( false )
    					.Layout ( Ext.Net.LayoutType.Fit )
    					.ContentFromSection ( this , "SouthRegion" , false )
    
    
    			)
    
    	)
    The following is my derived page...

    @section NorthRegion
    {
    	@(
    		X.ComponentLoader()
    			.AutoLoad(true)
    			.Url(this.Url.Action ("NorthRegion" , "Home"))
    			.Mode ( Ext.Net.LoadMode.Component )
    	)
    }
    
    @section WestRegion
    {
    
    	@(
    		X.ComponentLoader()	
    			.AutoLoad(true)
    			.Url( this.Url.Action ("WestRegion", "Home"))
    			.Mode (Ext.Net.LoadMode.Component )
    			
    	)
    }
    When i load the page, i get the following error...

    The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(Sy stem.Web.WebPages.HelperResult)' has some invalid arguments
    Thanks.
  4. #4
    I now have the page loading...it was just an error with the Razor Syntax...Razor can be very problematic...it did not like the space between
     @Html.X  ( )
    "Html.X" and the opening bracket. Why are razor parsing rules any different than c# parsing rules?

    Now it seems that the Control i am loading into the "ContentFromSection" does not get rendered but there are no errors on the page.

    I am calling the "Home" controller from the "Test" controller when rendering the "ContentFromSection". I put a break point in there and the controller does not get called. The following is the code

    @section NorthRegion
    {
    	
    	@(
    			
    		X.ComponentLoader()
    			.AutoLoad(true)
    			.Mode ( Ext.Net.LoadMode.Component )
    			.Url ( this.Url.Action ( "Header" , "Home" ) )
    			.Params
    			(
    				new Ext.Net.Parameter ( "token" , this.Model.Token )
    			)
    			
    	)
    
    }
    Last edited by edip; Apr 29, 2016 at 6:31 PM.
  5. #5
    Hello @edip!

    I'm not really sure on your exact scenario, but I also don't see how you defined your controllers to give it a try... You are trying to call the action Header() from the Home controller, right?..

    The pieces look loose, I can't figure your page from the fragments you provided, probably the wrong part is somewhere else. Hard to say; I know we may sound repetitive here, but without a test case to play we can but point you to examples that might help...

    Look at those two:
    - Section
    - Section from page

    Probably they have the missing piece for your code to work!

    Not helpful? Fancy us a full test case, we might be able to understand what's up to it. Hope you understand!
    Fabrício Murta
    Developer & Support Expert
  6. #6
    Hi edip,

    Please do not edit forum posts and remove your original questions. That throws the thread off because readers cannot understand what is being asked.

    If you need to correct something within the forum post, no problem. If an edit removes the content will get edit will get reversed.
    Geoffrey McGill
    Founder

Similar Threads

  1. Replies: 12
    Last Post: Jul 28, 2015, 10:11 AM
  2. Replies: 1
    Last Post: Jun 05, 2014, 2:22 PM
  3. Replies: 8
    Last Post: Nov 28, 2013, 6:39 AM
  4. Replies: 0
    Last Post: Feb 04, 2013, 6:55 AM
  5. Replies: 7
    Last Post: Jan 29, 2013, 11:59 AM

Posting Permissions