i working on web form project deploy on production. in project, dynamic folder created on fly , put new css style per data configuration database. handled handlers in web form. application works locally without error. when publish on production not find dynamic created css file path. not physical exists creates on fly. fails download css , missing images , styles. team had developed application , moving firehost azure site. working on firehost no luck on azure site yet. tried remove manifest file in production adding remove attributes .manifest in web.config. no luck yet. appreciate thanks
i getting 404 errors, failed load resource: server responded status of 404 (not found) have style css inject way in site.master page.
<link href="/styles/dynamic/companysite.css" rel="stylesheet" type="text/css" /> it did not mentioned handlers in web.config. there separate handlers folders , pages. in pages code behind file in page load method.
stringbuilder sb = new stringbuilder(file.readalltext(server.mappath("~/styles/companystyles.css"))); string sprimarycolor = "#b1d74c"; string ssecondarycolor = "#8bbb29"; string sprimarytextcolor = "#000"; string ssecondarytextcolor = "#000"; string sbannerid = "1"; try { var settings = new companysettingdatalogic().retrieve(); if (settings != null) { sprimarycolor = settings.primary_color_txt; ssecondarycolor = settings.secondary_color_txt; sprimarytextcolor = settings.primary_text_color_txt; ssecondarytextcolor = settings.secondary_text_color_txt; } var bannerid = new companythemedatalogic().getbannerid(); if (bannerid.hasvalue) sbannerid = bannerid.value.tostring(); } catch (exception ex) { new data.config.errorlogdatalogic().logexception(ex); } sb.replace("#primary#", sprimarycolor); sb.replace("#secondary#", ssecondarycolor); sb.replace("#primarytextcolor#", sprimarytextcolor); sb.replace("#secondarytextcolor#", ssecondarytextcolor); sb.replace("#bannerimageid#", sbannerid); response.clear(); response.clearcontent(); response.clearheaders(); response.cache.setcacheability(httpcacheability.private); response.cache.setexpires(datetime.now.adddays(2)); response.contenttype = "text/css"; response.write(sb.tostring());
its not physical exists creates on fly. fails download css , missing images , styles.
where have stored files after folder being created? store them in website azure vm disk? please note
the vm disk storage not persistent
if have >= 2 instances on azure host web app, , created css/images files on 1 instance (vm), later end user may hit other instance has no such files.
so please store files in azure storage - blob , use url in project connect css/image files
Comments
Post a Comment