? orus casino? bodog? ruleta? luckia? betano? sportium? spin casino? stakes? 3 reyes? 888? lottoland? coolbet? 777 casino? gana777? betfair? bwin? yak casino? ivy casino? oddschecker? red casino? netbet? william hill? vip casino? rey casino? marathonbet? dafabet? sol casino? 1bet? winland? bet777? parimatch? 18bet? 888casino? campobet? mostbet? ganabet? rushbet? betcris? betsson? lucky? novibet? winner? winpot? betmaster? betmexico? cancun? playcity? strendus? pokerstars? codere? caliente? fun88? bbrbet? 1win? 10bet? betway? pin up? spinbet? 7cslot? pickwin? spin bet? mr fortune? w88? pragmatic? gamdom? crasher? jojobet? betmex? bcasino? foliatti? winner mx? bets 10? big bola? bet master? inbet? 7slots? lucky day? m777? mexplay? luckydays? bet caliente? 1x? plinko

Forum


HomeHomePremiumPremiumDevelopmentDevelopmentNesting Razor Controls within a DNN ModuleNesting Razor Controls within a DNN Module
Previous
 
Next
New Post
9/25/2015 9:36 AM
 

Hello,

Does anyone know how to render html from a razor file from within another razor file? In other words how to nest Razor Controls.

I am new to Razor but thought @Html.Partial would do the trick but that doesn't seem to be supported in DNN (I hope I'm mistaken). Is there another way to do this? i.e. The equivalent of:
@Html.Partial("~/controls/MyControl.cshtml", Model);

I assume this would merge the Model object properties with the razor file and write the output to the containing file. But I don't think this is available in DNN's Razor version as I can't get Html.Partial in the intellisense.

 

Best Regards,

Steve


 
New Post
9/25/2015 3:41 PM
 

OK I got a tip to use RenderPage, for anyone who's interested, say you have two Razor templates razor1.cshtml and razor2.cshtml, where the first template needs to pass an object variable 'Model' which has a property 'Title', to the 2nd template.

Then in Razor1.cshtml use:
@RenderPage("Razor2.cshtml", new { data = Model });

In Razor2.cshtml use:

<h1>@PageData["data"].Title</h1>
OR
@{var SomeValue = PageData["data"];}
<h1>@SomeValue.Title 2</h1>

 

All the best,

 

Steve

 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmentNesting Razor Controls within a DNN ModuleNesting Razor Controls within a DNN Module



Try FREE
30 days money back guaranteed