i have 2 apps. 1 of them web app , other 1 mobile app. trying parse 1 of views web app , compile html file mobile app. structure of view in web app follows
- app.cshtml
- partialview1.cshtml
- partialview2.cshtml
- ....
the web app built in asp.net mvc , using microsoft visual studio cordova built mobile apps.
i have separate project, takes app.cshtml , compile index.html mobile app. here structure of app.cshtml file
@model account @{ layout = "~/views/shared/_layout.cshtml"; viewbag.title = texts.app; } @section head{ @styles.render("~/content/css/app") } @section scripts { @scripts.render("~/bundles/moment") @scripts.render("~/bundles/tippnett/app") <script> var userid = '@model.id'; tippnett.startapp(); </script> } <div id="appview" class="loading"> <div id="workspace" class="map_canvas"> <section class="other-stuff"> @renderpage("~/views/home/subpagesforapp/_locationwindow.cshtml") @renderpage("~/views/home/subpagesforapp/_movelocationwindow.cshtml") @renderpage("~/views/home/subpagesforapp/_orderwindow.cshtml") @renderpage("~/views/home/subpagesforapp/_createlocation.cshtml") @renderpage("~/views/home/subpagesforapp/_orderslistwindow.cshtml") @renderpage("~/views/home/subpagesforapp/_reportabuse.cshtml") </section> </div> <div class="locations-list" data-bind="visible:locationview"> @renderpage("~/views/home/subpagesforapp/_locationlist.cshtml") </div> <div id="loading-wale"> <div id="loading-info"> <div> <i class="spinner"> </i> </div> <div>@texts.loading</div> </div> </div> </div> <div class="show-for-small" id="stick-menu" data-role="footer"> <div class="icon-bar three-up "> <a class="item active locations" data-bind="click: openlocationview.bind($data,true)"> <i class="fi-marker"></i> <label>@texts.location</label> </a> <a class="item maps" data-bind="click: openmapview.bind($data,true)"> <i class="fi-map"></i> <label>@texts.maps</label> </a> <a class="item notifications" data-bind="click: openorders.bind($data,true)"> <i class="fi-list"></i> <span class="order-notification-counter notification-counter" data-bind=" text: orders().length,visible: orders().length > 0"></span> <span class="matches-notification-counter notification-counter" data-bind=" text: matches().length,visible: matches().length > 0"></span> <label> @texts.orderslabel </label> </a> </div> i have looked razorengine.razor.compile, no luck. have looked library http://razorengine.codeplex.com/, couldn't anywhere.
cshtml run server side,cordova app run in mobile(client)
think can't run mvc on mobile,you should use mobile framework
html template,js call ajax data,and bind html template.
Comments
Post a Comment