javascript - FancyBox popup loses all styling when loading Partial View -


i trying load partial view in mvc project using fancybox. seems load content correctly. of anyway seems cut page short, loses styling view when loads it.

i have included css files in partial view still no luck.

my partial view follows:

@model approvalsystem.viewmodels.requestdetailviewmodel @section styles {     <link href="~/content/site.css" rel="stylesheet" />     <link href="~/content/material.min.css" rel="stylesheet" />     <link href="~/content/jquery.fancybox.min.css" rel="stylesheet" /> } //content here - not providing quite large. classes , remain in partial view though cannot see being issue. @section scripts {     <script>         $(document).ready(function () {             $('[data-fancybox]').fancybox({                 maxwidth    : 800,                 maxheight   : 600,                 fittoview   : false,                 width       : '70%',                 height      : '70%',                 autosize    : false,                 closeclick  : false,                 openeffect  : 'none',                 closeeffect : 'none'             });         })     </script>     } 

my link open fancybox is:

<a data-fancybox href="@url.action("detailpartial", new { id = model.request.parentrequestid })" class="mui-btn mui-btn--fab mui-btn--small fancybox.ajax">@model.request.parentrequestid</a> 

and controller method return partial view is:

public async task<actionresult> detailpartial(int id) {     var request = _uow.requestservice.get(id);     var currentuser = await azuregraph.getuser();     viewbag.currentuser = currentuser.displayname;     viewbag.nextapprover = _uow.responseservice.get().where(r => r.requestid == id && r.responsestatus == requeststatus.notprocessed).select(r => r.responder).firstordefault();     requestdetailviewmodel viewmodel = new requestdetailviewmodel()     {         request = request     };      if (request.folderid != null)         viewmodel.attachments = await azuregraph.getfilesystemobjects(request.folderid);     else         viewmodel.attachments = new list<fsobject>();      return partialview("detailpartial", viewmodel); } 

i out of ideas , appreciated.

edit - added screenshot

enter image description here

managed solve this. issue because partial view had no layout, sections werent being loaded correctly. created basic layout partial views , works expected.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -