Re: [Cppcms-users] Bad dynamic_cast! (http_context.cpp:150)
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-01-22 06:53:30
|
Hi, Because the content that you provide in the render function should be a type of a subtype of the "uses" type for this template. For example <% view index uses data::index extends master %> Should receive a content of type data::index or one derived from it to render and you don't pass correct content. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.sf.net/ CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/ >________________________________ > From: sergey lavrov <ccp...@gm...> >To: cpp...@li... >Sent: Sunday, January 22, 2012 12:11 AM >Subject: [Cppcms-users] Bad dynamic_cast! (http_context.cpp:150) > > >lib: cppcms-0.99.11 >os: windows 7 x86_64 >compiler: msvc 2010 > > >Dear All! > >I have strange error with my application when calling function render("myapp", "about", content); from controller: >2012-01-22 01:57:30; cppcms, error: Caught exception [Bad dynamic_cast!] > (http_context.cpp:150) > > >I don't have error if I call render() function with another template name render("myapp", "index", content) from the same controller . > > >about.tmpl: ><% c++ #include "../../include/data/about.h" %> ><% skin myapp %> ><% view about uses data::about extends master %> ><% template body() %> ><h2>about::index == <%= text %></h2> ><% end template%> ><% end view %> ><% end skin %> > > >index.tmpl: ><% c++ #include "../../include/data/index .h" %> ><% skin myapp %> ><% view index uses data::index extends master %> ><% template body() %> ><h2>index::index == <%= text %></h2> ><% end template%> ><% end view %> ><% end skin %> > > >Please help. > > >Thanks in advance. >------------------------------------------------------------------------------ >Try before you buy = See our experts in action! >The most comprehensive online learning library for Microsoft developers >is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, >Metro Style Apps, more. Free future releases when you subscribe now! >http://p.sf.net/sfu/learndevnow-dev2 >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |